feat(cron): per-job model fallback override via payload.fallbacks (#26120)#26304
Merged
Takhoffman merged 1 commit intoopenclaw:mainfrom Mar 1, 2026
Merged
Conversation
f3e2a87 to
db4bf10
Compare
Contributor
|
Autoland update: rebased on latest Brutal quality take:
Verification run (worktree
All checks passed. |
zooqueen
added a commit
to hanzoai/bot
that referenced
this pull request
Mar 1, 2026
…openclaw#26120) (openclaw#26304) Cherry-pick of upstream f902697.
CyberK13
pushed a commit
to CyberK13/clawdbot
that referenced
this pull request
Mar 1, 2026
…openclaw#26120) (openclaw#26304) Co-authored-by: yinghaosang <[email protected]>
ansh
pushed a commit
to vibecode/openclaw
that referenced
this pull request
Mar 2, 2026
…openclaw#26120) (openclaw#26304) Co-authored-by: yinghaosang <[email protected]>
steipete
pushed a commit
to Sid-Qin/openclaw
that referenced
this pull request
Mar 2, 2026
…openclaw#26120) (openclaw#26304) Co-authored-by: yinghaosang <[email protected]>
safzanpirani
pushed a commit
to safzanpirani/clawdbot
that referenced
this pull request
Mar 2, 2026
…openclaw#26120) (openclaw#26304) Co-authored-by: yinghaosang <[email protected]>
steipete
pushed a commit
to Sid-Qin/openclaw
that referenced
this pull request
Mar 2, 2026
…openclaw#26120) (openclaw#26304) Co-authored-by: yinghaosang <[email protected]>
robertchang-ga
pushed a commit
to robertchang-ga/openclaw
that referenced
this pull request
Mar 2, 2026
…openclaw#26120) (openclaw#26304) Co-authored-by: yinghaosang <[email protected]>
hanqizheng
pushed a commit
to hanqizheng/openclaw
that referenced
this pull request
Mar 2, 2026
…openclaw#26120) (openclaw#26304) Co-authored-by: yinghaosang <[email protected]>
execute008
pushed a commit
to execute008/openclaw
that referenced
this pull request
Mar 2, 2026
…openclaw#26120) (openclaw#26304) Co-authored-by: yinghaosang <[email protected]>
dorgonman
pushed a commit
to kanohorizonia/openclaw
that referenced
this pull request
Mar 3, 2026
…openclaw#26120) (openclaw#26304) Co-authored-by: yinghaosang <[email protected]>
sachinkundu
pushed a commit
to sachinkundu/openclaw
that referenced
this pull request
Mar 6, 2026
…openclaw#26120) (openclaw#26304) Co-authored-by: yinghaosang <[email protected]>
zooqueen
added a commit
to hanzoai/bot
that referenced
this pull request
Mar 6, 2026
…openclaw#26120) (openclaw#26304) Cherry-pick of upstream f902697.
zooqueen
pushed a commit
to hanzoai/bot
that referenced
this pull request
Mar 6, 2026
…openclaw#26120) (openclaw#26304) Co-authored-by: yinghaosang <[email protected]>
Mateljan1
pushed a commit
to Mateljan1/openclaw
that referenced
this pull request
Mar 7, 2026
…openclaw#26120) (openclaw#26304) Co-authored-by: yinghaosang <[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
Cron jobs that pin a specific model (e.g.
kimi-coding/k2p5) have no way to declare per-job fallbacks — if the model hits a rate limit, the job just fails and bumpsconsecutiveErrors. The globalagents.defaults.model.fallbackschain works, but you can't tailor fallback strategies per job without creating separate agents for each one.Added
payload.fallbackstoagentTurncron payloads so each job can declare its own fallback chain. The existingrunWithModelFallbackmachinery handles the rest — rate-limit detection, cooldown probing, candidate iteration all work unchanged.Closes #26120
lobster-biscuit
Root Cause
cronAgentTurnPayloadSchemaonly exposedmodelas a string override. ThefallbacksOverrideparam passed torunWithModelFallbackinrunCronIsolatedAgentTurnwas hardwired toresolveAgentModelFallbacksOverride(cfg, agentId)— no path for per-job input.Changes
payload.fallbacks(string array) takes priority when defined. Empty[]explicitly disables fallbacks. Undefined falls through to agent/global config as before.Fallback resolution order is now:
payload.fallbacks→agents.list[id].model.fallbacks→agents.defaults.model.fallbacksFiles
src/gateway/protocol/schema/cron.ts— addedfallbackstocronAgentTurnPayloadSchemasrc/cron/types.ts— addedfallbackstoCronPayloadandCronPayloadPatchsrc/cron/isolated-agent/run.ts— extract payload fallbacks, pass asfallbacksOverridewith priority over agent-level configExample
{ "payload": { "kind": "agentTurn", "message": "Generate daily digest", "model": "kimi-coding/k2p5", "fallbacks": ["anthropic/claude-sonnet-4-6", "openai-codex/gpt-5.3-codex"] } }Tests
src/cron/isolated-agent/run.payload-fallbacks.test.ts— 3 tests: payload fallbacks forwarded torunWithModelFallback, agent-level fallbacks used when payload omits them, empty array disables fallbackspnpm build && pnpm checkpasspnpm protocol:checkpassGreptile Summary
Added
payload.fallbacksfield to cronagentTurnpayloads, allowing per-job model fallback configuration. This extends the existing fallback system by enabling jobs to define their own fallback chains instead of inheriting from agent or global config.The change integrates cleanly with the existing
runWithModelFallbackmachinery insrc/cron/isolated-agent/run.ts:408-419. The resolution order is:payload.fallbacks→ agent-level fallbacks → global defaults. An empty array explicitly disables fallbacks for that job.Key changes:
src/gateway/protocol/schema/cron.ts:10adds optionalfallbacks: Type.Array(Type.String())src/cron/types.ts:65,81document the new fieldpayload.fallbackswithArray.isArraycheck before passing torunWithModelFallbackConfidence Score: 5/5
??operator to preserve existing fallback resolution behavior whenpayload.fallbacksis undefined, and theArray.isArraycheck ensures type safety. Tests verify all three scenarios (custom fallbacks, inherited fallbacks, disabled fallbacks). No modifications to existing behavior.Last reviewed commit: f3e2a87