-
-
Notifications
You must be signed in to change notification settings - Fork 80.7k
fix(agent): agents.defaults.model.fallbacks not inherited by isolated cron sessions #91362
Copy link
Copy link
Closed
Closed
Copy link
Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.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:auth-providerAuth, provider routing, model choice, or SecretRef resolution may break.Auth, provider routing, model choice, or SecretRef resolution may break.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.
Description
Metadata
Metadata
Assignees
Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.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:auth-providerAuth, provider routing, model choice, or SecretRef resolution may break.Auth, provider routing, model choice, or SecretRef resolution may break.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
Priority
None yet
Summary
When
agents.defaults.model.fallbacksis configured globally (e.g.["deepseek/deepseek-v4-flash", "moonshot/kimi-k2.6"]), this fallback list is not inherited by isolated cron sessions when the agent's model config is a plain string.Expected: Cron sessions should fall back to
agents.defaults.model.fallbackswhen the agent has no explicit fallbacks configured.Actual: Cron sessions get an empty fallback chain (
[]), causing single-point-of-failure on the primary model.Root Cause
In
resolveSelectedModelFallbacksOverride(agent-scope.ts):A string model config returns
[](semantically "no fallbacks explicitly set"), which preventsresolveFallbackCandidatesUncachedfrom falling through to global defaults:Since
[] !== undefinedistrue, the globalagents.defaults.model.fallbacksis never consulted.Full Call Chain
Impact
payload.fallbackshave no model fallback chainagents.defaults.model.fallbacksconfig is silently ignoredTemporary Workaround
Explicitly set
payload.fallbackson each cron job:{ "payload": { "kind": "agentTurn", "fallbacks": ["deepseek/deepseek-v4-flash", "moonshot/kimi-k2.6"] } }Proposed Fix
In
resolveSelectedModelFallbacksOverride, when the agent model is a plain string (primary ref only, no explicitfallbacksfield), returnundefinedinstead of[]:Or alternatively, in
resolveEffectiveModelFallbacks, whenhasSessionModelOverrideis false, fall through to global defaults:Environment
{ "agents": { "defaults": { "model": { "primary": "deepseek/deepseek-v4-pro", "fallbacks": ["deepseek/deepseek-v4-flash", "moonshot/kimi-k2.6"] } }, "list": [ { "id": "main", "model": "deepseek/deepseek-v4-pro" } ] } }payload.fallbacksreproduce the issue; addingpayload.fallbacksworks around it.Verification
Confirmed by code inspection of the following source modules in
dist/:agent-scope-BcYNOCQG.js—resolveSelectedModelFallbacksOverridereturns[]for string modelsrun-session-state-D-DIroy6.js—resolveCronFallbacksOverridepriority chainmodel-fallback-hP2QoTn4.js—resolveFallbackCandidatesUncachedchecksfallbacksOverride !== undefinedisolated-agent-Cw8sZTVo.js—resolveCronModelSelectiondeterminesuseSubagentFallbacks