fix(cron): handle sessions list cron model override#21279
Merged
Takhoffman merged 7 commits intoopenclaw:mainfrom Mar 1, 2026
Merged
fix(cron): handle sessions list cron model override#21279Takhoffman merged 7 commits intoopenclaw:mainfrom
Takhoffman merged 7 commits intoopenclaw:mainfrom
Conversation
7214674 to
56c83f9
Compare
bedd794 to
c344bd4
Compare
…run (#21057) Add failing test that proves the cron payload model override is not persisted on the session entry when the agent run throws, causing sessions_list to fall back to the agent default model. Co-Authored-By: Claude Opus 4.6 <[email protected]>
…1057) Set the cron payload model on the session entry before the pre-run persist so that sessions_list shows the correct model even when the run fails or is still in progress. Co-Authored-By: Claude Opus 4.6 <[email protected]>
…21057) Replace the weak pre-run persist test with one that captures deep snapshots at each updateSessionStore call, proving the model override is on the session entry before the agent run starts. Co-Authored-By: Claude Opus 4.6 <[email protected]>
…21057) Wrap the pre-run persistSessionEntry in try-catch with logWarn so a filesystem error does not abort the entire cron run for a cosmetic persist. Add tests for: disallowed payload model early-return, session-level /model override, pre-run persist failure resilience, and default model (no override) pre-run persistence. Fix stale line-number references in test comments and strengthen persist-count assertion. Co-Authored-By: Claude Opus 4.6 <[email protected]>
…lt type Co-Authored-By: Claude Opus 4.6 <[email protected]>
c344bd4 to
cad3fa1
Compare
Contributor
|
PR #21279 - fix(cron): handle sessions list cron model override (#21279) Merged via squash.
Thanks @altaywtf! |
Contributor
|
PLACEHOLDER |
Contributor
|
PR #21279 - fix(cron): handle sessions list cron model override (#21279) Merged via squash.
Thanks @altaywtf! |
github-actions bot
pushed a commit
to tankerwng2/openclaw
that referenced
this pull request
Mar 1, 2026
…thanks @altaywtf Verified: - pnpm install --frozen-lockfile - pnpm build - pnpm check - pnpm test:macmini Co-authored-by: altaywtf <[email protected]> Co-authored-by: Tak Hoffman <[email protected]>
Member
Author
|
😁🍻 cheers @Takhoffman, I have two more PRs if you have time good sir:
and one from my colleague @glitch418x: |
ansh
pushed a commit
to vibecode/openclaw
that referenced
this pull request
Mar 2, 2026
…thanks @altaywtf Verified: - pnpm install --frozen-lockfile - pnpm build - pnpm check - pnpm test:macmini Co-authored-by: altaywtf <[email protected]> Co-authored-by: Tak Hoffman <[email protected]>
steipete
pushed a commit
to Sid-Qin/openclaw
that referenced
this pull request
Mar 2, 2026
…thanks @altaywtf Verified: - pnpm install --frozen-lockfile - pnpm build - pnpm check - pnpm test:macmini Co-authored-by: altaywtf <[email protected]> Co-authored-by: Tak Hoffman <[email protected]>
safzanpirani
pushed a commit
to safzanpirani/clawdbot
that referenced
this pull request
Mar 2, 2026
…thanks @altaywtf Verified: - pnpm install --frozen-lockfile - pnpm build - pnpm check - pnpm test:macmini Co-authored-by: altaywtf <[email protected]> Co-authored-by: Tak Hoffman <[email protected]>
steipete
pushed a commit
to Sid-Qin/openclaw
that referenced
this pull request
Mar 2, 2026
…thanks @altaywtf Verified: - pnpm install --frozen-lockfile - pnpm build - pnpm check - pnpm test:macmini Co-authored-by: altaywtf <[email protected]> Co-authored-by: Tak Hoffman <[email protected]>
robertchang-ga
pushed a commit
to robertchang-ga/openclaw
that referenced
this pull request
Mar 2, 2026
…thanks @altaywtf Verified: - pnpm install --frozen-lockfile - pnpm build - pnpm check - pnpm test:macmini Co-authored-by: altaywtf <[email protected]> Co-authored-by: Tak Hoffman <[email protected]>
hanqizheng
pushed a commit
to hanqizheng/openclaw
that referenced
this pull request
Mar 2, 2026
…thanks @altaywtf Verified: - pnpm install --frozen-lockfile - pnpm build - pnpm check - pnpm test:macmini Co-authored-by: altaywtf <[email protected]> Co-authored-by: Tak Hoffman <[email protected]>
execute008
pushed a commit
to execute008/openclaw
that referenced
this pull request
Mar 2, 2026
…thanks @altaywtf Verified: - pnpm install --frozen-lockfile - pnpm build - pnpm check - pnpm test:macmini Co-authored-by: altaywtf <[email protected]> Co-authored-by: Tak Hoffman <[email protected]>
dorgonman
pushed a commit
to kanohorizonia/openclaw
that referenced
this pull request
Mar 3, 2026
…thanks @altaywtf Verified: - pnpm install --frozen-lockfile - pnpm build - pnpm check - pnpm test:macmini Co-authored-by: altaywtf <[email protected]> Co-authored-by: Tak Hoffman <[email protected]>
sachinkundu
pushed a commit
to sachinkundu/openclaw
that referenced
this pull request
Mar 6, 2026
…thanks @altaywtf Verified: - pnpm install --frozen-lockfile - pnpm build - pnpm check - pnpm test:macmini Co-authored-by: altaywtf <[email protected]> Co-authored-by: Tak Hoffman <[email protected]>
zooqueen
pushed a commit
to hanzoai/bot
that referenced
this pull request
Mar 6, 2026
…thanks @altaywtf Verified: - pnpm install --frozen-lockfile - pnpm build - pnpm check - pnpm test:macmini Co-authored-by: altaywtf <[email protected]> Co-authored-by: Tak Hoffman <[email protected]>
Mateljan1
pushed a commit
to Mateljan1/openclaw
that referenced
this pull request
Mar 7, 2026
…thanks @altaywtf Verified: - pnpm install --frozen-lockfile - pnpm build - pnpm check - pnpm test:macmini Co-authored-by: altaywtf <[email protected]> Co-authored-by: Tak Hoffman <[email protected]>
alexey-pelykh
pushed a commit
to remoteclaw/remoteclaw
that referenced
this pull request
Mar 16, 2026
…thanks @altaywtf Verified: - pnpm install --frozen-lockfile - pnpm build - pnpm check - pnpm test:macmini Co-authored-by: altaywtf <[email protected]> Co-authored-by: Tak Hoffman <[email protected]> (cherry picked from commit 98e30dc)
alexey-pelykh
added a commit
to remoteclaw/remoteclaw
that referenced
this pull request
Mar 16, 2026
* fix(cron): handle sessions list cron model override (openclaw#21279) thanks @altaywtf Verified: - pnpm install --frozen-lockfile - pnpm build - pnpm check - pnpm test:macmini Co-authored-by: altaywtf <[email protected]> Co-authored-by: Tak Hoffman <[email protected]> (cherry picked from commit 98e30dc) * fix: adapt cron model override test imports for fork model-fallback.js and model-selection.js paths differ in fork. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]> --------- Co-authored-by: Altay <[email protected]> Co-authored-by: altaywtf <[email protected]> Co-authored-by: Tak Hoffman <[email protected]> Co-authored-by: Claude Opus 4.6 (1M context) <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
sessions_listshows the agent default model (e.g. Opus) instead of the actual cron payload model override (e.g. Sonnet), making cost tracking unreliablemodel/modelProvideron the session entry before the agent run (not only after), wrapped in best-effort try-catchChange Type (select all)
Scope (select all touched areas)
Linked Issue/PR
User-visible / Behavior Changes
sessions_listnow correctly reflects the cron payload model override for failed and in-progress runs, instead of falling back to the agent default model.Security Impact (required)
Repro + Verification
Environment
payload.modelmodel: "anthropic/claude-sonnet-4-6"Steps
claude-opus-4-6payload.model: "anthropic/claude-sonnet-4-6"sessions.listwhile it runs or after it failsExpected
sessions_listshowsclaude-sonnet-4-6for the cron sessionActual
sessions_listshowsclaude-opus-4-6(the agent default)Evidence
6 test cases covering: error path, race condition (point-in-time persist snapshots), disallowed model rejection, session-level
/modeloverride, persist failure resilience, and default model (no override).Human Verification (required)
src/cron/isolated-agent/tests pass; new tests confirmed failing before fix and passing after/modeloverride, no payload overridesessions.listcallCompatibility / Migration
Failure Recovery (if this breaks)
src/cron/isolated-agent/run.ts(lines 433-434)src/cron/isolated-agent/run.tssessions_listRisks and Mitigations
agentMetaon success; the pre-run value is only visible during the run or after a failureGreptile Summary
Fixed race condition where
sessions_listshowed incorrect model for cron jobs when the run failed or was still in progress. The model override is now persisted to the session entry before the agent run executes, ensuring it reflects the intended cron model rather than falling back to the agent default.Confidence Score: 5/5
Last reviewed commit: 8eb6b13