openclaw - ✅(Solved) Fix [Bug]: openclaw doctor --fix repeatedly flags cron jobs for payload kind normalization without ever resolving (v2026.3.11) [2 pull requests, 1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#44505Fetched 2026-04-08 00:46:00
View on GitHub
Comments
1
Participants
2
Timeline
9
Reactions
0
Author
Participants
Timeline (top)
cross-referenced ×2labeled ×2referenced ×2closed ×1

After upgrading from 2026.3.8 to 2026.3.11, openclaw doctor --fix permanently reports "5 jobs need payload kind normalization" but the fix never persists — the warning reappears on every subsequent doctor run.

Root Cause

Root cause identified in source: In update-runner-CsfK3SMx.js, normalizePayloadKind() converts payload.kind to lowercase ("agentTurn""agentturn"), matches the "agentturn" branch, writes back "agentTurn" (the same value already stored), and returns true — incorrectly signalling a mutation occurred.

Fix Action

Fix / Workaround

Workaround: None — safe to ignore the warning as cron jobs execute correctly despite it.

PR fix notes

PR #44516: fix: normalizePayloadKind returns false when kind is already correct

Description (problem / solution / changelog)

Summary

Fix normalizePayloadKind in src/cron/store-migration.ts returning true even when payload.kind is already the correct camelCase value.

Problem

When payload.kind is already correct (e.g. "agentTurn"), the function lowercases it, matches, reassigns the identical value, and returns true — falsely indicating a mutation. This causes openclaw doctor --fix to perpetually report that migrations are needed.

Changes

Add equality checks before assignment so already-correct values return false (no mutation):

if (raw === "agentturn") {
  if (payload.kind === "agentTurn") return false;  // already correct
  payload.kind = "agentTurn";
  return true;
}

Same pattern applied for "systemEvent".

Fixes openclaw/openclaw#44505

Changed files

  • src/cron/store-migration.ts (modified, +2/-0)

PR #44576: fix: prevent false positive payload kind normalization for already-correct values

Description (problem / solution / changelog)

Summary

normalizePayloadKind() lowercased payload.kind, matched it, reassigned the same canonical value, and returned true — falsely signalling a mutation. This caused openclaw doctor --fix to perpetually report "N jobs need payload kind normalization" even though the values were already correct.

Changes

  • Add equality checks before assignment so already-correct camelCase values (agentTurn, systemEvent) return false immediately
  • Only 2 lines added in src/cron/store-migration.ts

Testing

  • Existing tests pass (2/2)
  • Manual verification: 10/10 scenarios pass including idempotency (consecutive calls)

Fixes openclaw/openclaw#44505

Changed files

  • src/cron/store-migration.ts (modified, +6/-0)

Code Example

// Buggy code:
function normalizePayloadKind(payload) {
  const raw = typeof payload.kind === "string" ? payload.kind.trim().toLowerCase() : "";
  if (raw === "agentturn") {
    payload.kind = "agentTurn"; // no-op: value was already "agentTurn"
    return true;               // incorrectly signals a change was made
  }
  ...
}

// Fix: add equality guard
if (raw === "agentturn" && payload.kind !== "agentTurn") {
  payload.kind = "agentTurn";
  return true;
}

---
RAW_BUFFERClick to expand / collapse

Bug type

Regression (worked before, now fails)

Summary

After upgrading from 2026.3.8 to 2026.3.11, openclaw doctor --fix permanently reports "5 jobs need payload kind normalization" but the fix never persists — the warning reappears on every subsequent doctor run.

Steps to reproduce

  1. Have any cron jobs configured with payload.kind = "agentTurn" (the standard format).
  2. Update OpenClaw from 2026.3.8 to 2026.3.11.
  3. Run openclaw doctor — observe "5 jobs need payload kind normalization" warning.
  4. Run openclaw doctor --fix and confirm the repair when prompted.
  5. Run openclaw doctor again — observe the same warning reappears immediately.
  6. Repeat steps 4–5 indefinitely — warning never clears.

Expected behavior

openclaw doctor reports cron jobs are healthy after running --fix. The "needs payload kind normalization" warning should clear and not reappear on the next doctor run.

Actual behavior

The warning reappears every single time openclaw doctor is run, even immediately after a successful --fix. The cron jobs continue to function correctly — this is a false positive loop that never resolves.

Root cause identified in source: In update-runner-CsfK3SMx.js, normalizePayloadKind() converts payload.kind to lowercase ("agentTurn""agentturn"), matches the "agentturn" branch, writes back "agentTurn" (the same value already stored), and returns true — incorrectly signalling a mutation occurred.

// Buggy code:
function normalizePayloadKind(payload) {
  const raw = typeof payload.kind === "string" ? payload.kind.trim().toLowerCase() : "";
  if (raw === "agentturn") {
    payload.kind = "agentTurn"; // no-op: value was already "agentTurn"
    return true;               // incorrectly signals a change was made
  }
  ...
}

// Fix: add equality guard
if (raw === "agentturn" && payload.kind !== "agentTurn") {
  payload.kind = "agentTurn";
  return true;
}

OpenClaw version

2026.3.11 (29dc654)

Operating system

macOS 24.6.0 Darwin (arm64)

Install method

npm global

Model

anthropic/claude-sonnet-4-6

Provider / routing chain

openclaw -> anthropic (OAuth token / Claude Max plan)

Config file / key location

No response

Additional provider/model setup details

No response

Logs, screenshots, and evidence

Impact and severity

Affected: All users with cron jobs configured after updating to 2026.3.11 Severity: Annoying / low (cron jobs continue to run correctly; false positive only) Frequency: 100% reproducible — occurs on every openclaw doctor run Consequence: Users are repeatedly prompted to "repair" a problem that doesn't exist, eroding trust in the doctor tool and causing unnecessary gateway restarts.

Additional information

Last known good version: 2026.3.8 (3caab92) — doctor ran clean with no cron warnings. First known bad version: 2026.3.11 (29dc654) — warning appeared immediately after openclaw update.

The bug exists in both update-runner-CsfK3SMx.js and update-runner-CvNIx6g2.js (same logic in both files).

Workaround: None — safe to ignore the warning as cron jobs execute correctly despite it.

extent analysis

Fix Plan

To resolve the issue, we need to update the normalizePayloadKind() function in both update-runner-CsfK3SMx.js and update-runner-CvNIx6g2.js files.

  • Update the normalizePayloadKind() function to include an equality guard:
function normalizePayloadKind(payload) {
  const raw = typeof payload.kind === "string" ? payload.kind.trim().toLowerCase() : "";
  if (raw === "agentturn" && payload.kind !== "agentTurn") {
    payload.kind = "agentTurn";
    return true;
  }
  // ... rest of the function remains the same
}
  • Ensure to update both update-runner-CsfK3SMx.js and update-runner-CvNIx6g2.js files with the corrected function.

Verification

After applying the fix, run openclaw doctor and verify that the "5 jobs need payload kind normalization" warning no longer appears. If the warning persists, re-check the updates made to the normalizePayloadKind() function.

Extra Tips

  • Make sure to test the fix in a non-production environment before applying it to your production setup.
  • Consider submitting a pull request to the OpenClaw repository with the fix to help other users who may be experiencing the same issue.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

openclaw doctor reports cron jobs are healthy after running --fix. The "needs payload kind normalization" warning should clear and not reappear on the next doctor run.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING