Repository navigation
Closed as not planned
Closed as not planned
Copy link
Labels
P1High-priority user-facing bug, regression, or broken workflow.High-priority user-facing bug, regression, or broken workflow.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.impact:auth-providerAuth, provider routing, model choice, or SecretRef resolution may break.Auth, provider routing, model choice, or SecretRef resolution may break.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: 🦪 silver shellfishThin issue quality; more reproduction proof or environment detail is needed.Thin issue quality; more reproduction proof or environment detail is needed.
Description
Bug Report
Version: 2026.7.1 (2d2ddc4)
Summary
Isolated cron jobs with an explicit payload.model override leak that model back into the parent/main session after the cron job runs. The main session's model silently changes from its configured default to whatever model the cron job used.
Impact
- Main session silently switches models mid-conversation without user action
- If cron jobs use expensive models (Sonnet, Opus) for cost-effective processing, the main session inherits that expensive model
- User must manually reselect the default model after every cron job run
- Makes
agents.defaults.model.primarymeaningless when cron jobs are active
Reproduction
- Configure agent default model:
agents.defaults.model.primary: "moonshot/kimi-k2.6" - Create an isolated cron job with
payload.model: "deepseek/deepseek-v4-flash"andsessionTarget: "isolated" - From the WebChat UI, confirm the main session model is
moonshot/kimi-k2.6 - Trigger the isolated cron job (or wait for scheduled run)
- Observed: Main session model changes to
deepseek/deepseek-v4-flashimmediately or shortly after the cron job runs - Expected: Main session model remains
moonshot/kimi-k2.6(the configured default)
Root Cause (suspected)
The session-management-compaction logic appears to carry "explicit user-selected model/auth overrides" from the isolated cron session back to the parent session entry, rather than keeping it scoped to the isolated run.
This is a regression between 2026.6.11 and 2026.7.1. Issue #77339 (fixed in 2026.6.11) addressed a similar "cached model override" issue for fresh sessions.
Related but distinct issues:
- Isolated cron jobs with explicit sessionKey overwrite parent session's updatedAt, preventing daily reset #51000: isolated cron sessionKey overwriting parent
updatedAt - LiveSessionModelSwitch blocks isolated cron sessions with explicit model override #57581: LiveSessionModelSwitch blocking isolated cron sessions
- Cron job payload.model override ignored — isolated sessions run on agent primary instead #67598: cron payload.model ignored, runs on agent primary
Workaround
- Downgrade to 2026.6.11 (the fix for fix(auto-reply): clear runtime model cache on reset #77339 is active there, confirmed working)
- After every cron run, manually reselect the default model
Environment
- OpenClaw 2026.7.1 (2d2ddc4)
- Running in Docker on Ubuntu Linux x64
- WebChat UI (browser incognito)
- Multiple cron jobs with various payload.model values
Reacted by clawsweeper
Metadata
Metadata
Assignees
Labels
P1High-priority user-facing bug, regression, or broken workflow.High-priority user-facing bug, regression, or broken workflow.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.impact:auth-providerAuth, provider routing, model choice, or SecretRef resolution may break.Auth, provider routing, model choice, or SecretRef resolution may break.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: 🦪 silver shellfishThin issue quality; more reproduction proof or environment detail is needed.Thin issue quality; more reproduction proof or environment detail is needed.
Type
Fields
Priority
None yet
Activity
clawsweeper commentedon Jul 16, 2026
Codex review: keeping this open for maintainer follow-up; there is still a little grit to resolve. Reviewed July 15, 2026, 10:22 PM ET / July 16, 2026, 02:22 UTC.
Summary
Keep open: the v2026.7.1 report has concrete user-visible session/model impact, but current main now separates detached cron execution keys from source session keys; without a focused regression or identifiable fix commit, it is not yet safe to close as implemented. Likely related people: steipete, shakkernerd, and vincentkoc based on the isolated-cron runtime history.
Reproducibility: no. high-confidence current-main reproduction has been established. The reporter supplies concrete steps for v2026.7.1, while current main's detached execution-key logic may already prevent that exact path.
Ways to help us reproduce this
Next step
Verify the exact reproduction against current main and identify whether the existing detached execution-key changes already fix it before dispatching a repair.
Review details
Best possible solution:
Add a regression that seeds a main session model, executes an isolated cron with a different payload model, and asserts the main session entry remains unchanged while the cron-owned entry records only run-local state; fix the execution/persistence boundary only if that test fails.
Do we have a high-confidence way to reproduce the issue?
No high-confidence current-main reproduction has been established. The reporter supplies concrete steps for v2026.7.1, while current main's detached execution-key logic may already prevent that exact path.
Is this the best way to solve the issue?
No, the suspected reverse compaction merge is not yet demonstrated by current source. The narrowest maintainable approach is first proving parent-entry immutability with a focused regression, then repairing whichever execution or persistence boundary fails it.
AGENTS.md: found and applied where relevant.
Remaining risk / open question:
Codex review notes: model internal, reasoning high; reviewed against 08ecf63bb608.
Label changes
Label changes:
P1: A released isolated-cron workflow reportedly changes the active main session's model silently, affecting ongoing conversations and model cost until manually corrected.impact:session-state: The reported failure crosses an isolation boundary and mutates model state associated with the parent/main session.impact:auth-provider: The issue changes the effective provider/model selection from the configured main-session default to the cron payload override.issue-rating: 🦪 silver shellfish: Current issue advisory state selects this label.clawsweeper:no-new-fix-pr: Current issue advisory state selects this label.clawsweeper:needs-maintainer-review: Current issue advisory state selects this label.Label justifications:
P1: A released isolated-cron workflow reportedly changes the active main session's model silently, affecting ongoing conversations and model cost until manually corrected.impact:session-state: The reported failure crosses an isolation boundary and mutates model state associated with the parent/main session.impact:auth-provider: The issue changes the effective provider/model selection from the configured main-session default to the cron payload override.Evidence reviewed
Acceptance criteria:
What I checked:
src/cron/isolated-agent/run.ts:3361, 08ecf63bb608)src/cron/isolated-agent/run.ts:3503, 08ecf63bb608)src/cron/isolated-agent/session.ts:884, 08ecf63bb608)docs/automation/cron-jobs.md. (docs/automation/cron-jobs.md:194, 08ecf63bb608)src/cron/isolated-agent/session.ts:823, 08ecf63bb608)Likely related people:
src/cron/isolated-agent/run.ts)src/cron/isolated-agent/run.ts,src/cron/isolated-agent/session.ts)src/cron/isolated-agent/run.ts,src/cron/isolated-agent/run-types.ts)How this review workflow works
@clawsweeper re-reviewcomments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.@clawsweeper re-reviewor@clawsweeper re-runon an open PR or issue to request a fresh review only.@clawsweeper reviewto request a fresh review only.@clawsweeper autofix,@clawsweeper automerge,@clawsweeper fix ci, or@clawsweeper address review.@clawsweeper explainto ask for more context, or@clawsweeper stopto stop active automation.steipete commentedon Jul 18, 2026
Maintainer verification: I cannot reproduce a cron-to-parent model leak on current main, and the current persistence/event paths do not contain a parent write for a literal isolated job.
Live proof used the official OpenAI API through an isolated QA environment:
36155.agent:main:main, modelopenai/gpt-5.6-luna.every,sessionTarget: isolated, payload modelopenai/gpt-5.6-sol, strict fallback list, delivery disabled.okand attributedopenai/gpt-5.6-solin run history.updatedAtvalue.openai/gpt-5.6-luna.The tested relevant source at
13ae897cfbd7is byte-identical in the cron/session/UI model-routing files to currentmainatcb5070101e94.Source audit also found no reverse-compaction path: literal isolated jobs enter Gateway execution as
cron:<jobId>, persist underagent:<agentId>:cron:<jobId>, and emit the cron run key. WebChat derives its picker from the selected session key and rejects nonmatching cron events. The reportedv2026.7.1standard Gateway path already used the same literal-isolated cron key, so the older explicit-session collision does not explain these reproduction steps.Closing as not reproducible/currently unsupported by the persistence boundary. If this still reproduces on a current build, please reopen with redacted output for
cron.get,sessions.describefor both main and cron keys before/after, and the outer agent-eventsessionKey; those distinguish a stored-row bug from a projection or UI-cache issue.