openclaw - 💡(How to fix) Fix [Bug]: cron job update patch with sessionKey: null serializes as string "null" instead of clearing the field

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…

When updating a cron job via the cron tool (action=update) and passing sessionKey: null in the patch object, the value is stored as the literal string "null" rather than clearing (unsetting) the session key field.

Root Cause

When updating a cron job via the cron tool (action=update) and passing sessionKey: null in the patch object, the value is stored as the literal string "null" rather than clearing (unsetting) the session key field.

Fix Action

Fix / Workaround

When updating a cron job via the cron tool (action=update) and passing sessionKey: null in the patch object, the value is stored as the literal string "null" rather than clearing (unsetting) the session key field.

  1. Create a cron job that has a sessionKey set (e.g. bound to a specific Discord channel session).
  2. Call cron(action="update", jobId="...", patch={ sessionKey: null }) to clear the binding.
  3. Observe the returned job object — sessionKey is "null" (string) instead of null (unset/absent).

Passing sessionKey: null in a patch should clear the session key, leaving it unset so that the job falls back to routing via sessionTarget alone.

RAW_BUFFERClick to expand / collapse

Description

When updating a cron job via the cron tool (action=update) and passing sessionKey: null in the patch object, the value is stored as the literal string "null" rather than clearing (unsetting) the session key field.

Steps to Reproduce

  1. Create a cron job that has a sessionKey set (e.g. bound to a specific Discord channel session).
  2. Call cron(action="update", jobId="...", patch={ sessionKey: null }) to clear the binding.
  3. Observe the returned job object — sessionKey is "null" (string) instead of null (unset/absent).

Expected Behavior

Passing sessionKey: null in a patch should clear the session key, leaving it unset so that the job falls back to routing via sessionTarget alone.

Actual Behavior

The field is set to the literal string "null", which does not match any real session. The job still routes via sessionTarget: "main" (correct fallback behavior in this case), but the stale string value is unexpected and could cause issues in other configurations.

Context

  • Attempted the patch twice — both sessionKey: null attempts produced the same result.
  • Workaround: since sessionTarget: "main" is set and no session named "null" exists, the heartbeat still routes correctly in practice.
  • OpenClaw version: current (as of 2026-05-18)

Environment

  • Host: macOS 15.7.5 (Darwin 24.6.0 x64)
  • Node: v22.22.2
  • Channel: webchat

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…

Still need to ship something?

×6

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

Back to top recommendations

TRENDING

openclaw - 💡(How to fix) Fix [Bug]: cron job update patch with sessionKey: null serializes as string "null" instead of clearing the field