-
-
Notifications
You must be signed in to change notification settings - Fork 79.1k
sessionKey silently overrides sessionTarget=isolated, causing cron jobs to collide with WebUI dashboard sessions #86202
Copy link
Copy link
Closed
Labels
P1High-priority user-facing bug, regression, or broken workflow.High-priority user-facing bug, regression, or broken workflow.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.ClawSweeper found a clear likely implementation shape for this issue.clawsweeper:queueable-fixClawSweeper marked this issue as an existing queue_fix_pr work candidate.ClawSweeper marked this issue as an existing queue_fix_pr work candidate.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:message-lossChannel message delivery can be lost, duplicated, or misrouted.Channel message delivery can be lost, duplicated, or misrouted.impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.Session, memory, transcript, context, or agent state can drift or corrupt.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.
Metadata
Metadata
Assignees
Labels
P1High-priority user-facing bug, regression, or broken workflow.High-priority user-facing bug, regression, or broken workflow.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.ClawSweeper found a clear likely implementation shape for this issue.clawsweeper:queueable-fixClawSweeper marked this issue as an existing queue_fix_pr work candidate.ClawSweeper marked this issue as an existing queue_fix_pr work candidate.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:message-lossChannel message delivery can be lost, duplicated, or misrouted.Channel message delivery can be lost, duplicated, or misrouted.impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.Session, memory, transcript, context, or agent state can drift or corrupt.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Summary
When a cron job has both
sessionTarget: "isolated"and an explicitsessionKeyvalue, OpenClaw uses thesessionKeyand ignoressessionTarget. There's no warning at creation, no indication inopenclaw cron list, and no documentation I could find calling this out.The practical result: cron jobs whose
sessionKeyhappens to be a WebUI dashboard session key will run INTO that dashboard session every time they fire. Symptoms include WebUI session-state confusion mid-conversation,AbortError: CLI run abortedwhen the user tries to interact after a cron firing, and cron output interleaving with dashboard messages in the same transcript.In my environment, I discovered 10 of 25 cron jobs had this collision, accumulated quietly over months. Every interval-based keepalive job was hijacking dashboard sessions on each firing.
Version
OpenClaw 2026.5.22 (a374c3a)— macOS, Homebrew install.Reproduction
openclaw cron addwhile the dashboard is the active session), create a cron jobopenclaw cron get <id>will show:{ "sessionTarget": "isolated", "sessionKey": "agent:main:dashboard:<active-session-uuid>", ... }Both fields are populated.
sessionTarget: "isolated"is silently ignored; the cron fires into the dashboard session on each run.Expected behavior
One of:
sessionTarget: "isolated"should always create a fresh session and ignore any inheritedsessionKeysessionTarget: "isolated"with a non-isolatedsessionKeyas a configuration errorCurrently neither happens. The override is silent and counterintuitive given the docs around
sessionTarget.Workaround
openclaw cron edit <full-uuid> --clear-session-keyon every affected job.sessionTarget: "isolated"then took effect properly.Related issues found while debugging
These compounded the difficulty of finding and fixing the primary bug:
A.
openclaw cron rm <partial-uuid>silently fails to persist$ openclaw cron rm abc12345 { "ok": true, "removed": false } # exit 0 $ openclaw cron get abc12345 GatewayClientRequestError: cron job not found: abc12345Looks like a successful delete. But
jobs.jsonstill has the job. On gateway restart, the job comes back.Only full UUIDs trigger an actual persisted delete (returns
"removed": true). Partial-IDrmmodifies in-memory state but doesn't write to disk.This actively misled debugging — jobs thought to be deleted came back after a routine restart.
B.
openclaw cron listdoesn't showsessionKeyThere's no
sessionKeycolumn incron listoutput and no--show-session-keyflag. To audit for collisions you have to eithercron geteach job individually or script againstjobs.jsondirectly. Both are nuisances that masked this issue.Suggestion: add a column or a
--columns sessionKeyopt-in.C. No
openclaw cron edit --clear-modelflagTo remove a redundant
payload.modeloverride (common doctor warning), you have to editjobs.jsonby hand.--clear-session-key,--clear-tools, and--clear-agentall exist;--clear-modelwould complete the set.D. Doctor warning for "cron model overrides" is too noisy
It warns about all jobs with
payload.modelset, but many overrides are deliberate (cheap models for keepalive, premium for analysis). The warning should probably distinguish:Currently it just counts both, which makes the warning hard to act on.
Suggested fix priority
sessionTargetvssessionKey, and surface a warning when both are set (or makesessionTarget: "isolated"always win)cron rm <partial-uuid>silent persistence failuresessionKeyvisibility tocron list--clear-modeltocron editHow I noticed
Tracing
AbortError: CLI run abortederrors that appeared mid-conversation in the WebUI. Eventually traced through gateway logs, agent session files, andjobs.jsonto find that a 3-hour cron job shared itssessionKeywith the active dashboard session. The cron ran, executed for 2 minutes, ended withNO_REPLY— and the next message sent in the WebUI hit the session in a mid-cron state and aborted.Once the pattern was clear, grepping
jobs.jsonfordashboardin sessionKey revealed 9 more jobs with the same trap.