fix(cron): honor subagent model fallbacks#82302
Conversation
|
Codex review: needs maintainer review before merge. Summary Reproducibility: yes. at source level. Current Real behavior proof Next step before merge Security Review detailsBest possible solution: Land one targeted subagent-aware cron fallback fix after maintainer review, and keep the linked issue open until the chosen PR merges. Do we have a high-confidence way to reproduce the issue? Yes, at source level. Current Is this the best way to solve the issue? Yes. The PR takes the narrow maintainable path by carrying the selected subagent fallback policy into both the outer fallback runner and embedded failover flag while preserving payload, hook, session, and agent-primary behavior. Acceptance criteria:
What I checked:
Likely related people:
Remaining risk / open question:
Codex review notes: model gpt-5.5, reasoning high; reviewed against cce12697a1ee. |
59c7741 to
d6f2bb8
Compare
|
Landed via rebase merge onto
Thanks @chrisgwynne! |
Fixes #74985.
Summary:
agents.*.subagents.model.fallbacksinto bothrunWithModelFallbackand the embedded runner's internalfallbackConfiguredchecks.Verification:
node scripts/run-vitest.mjs src/cron/isolated-agent/run.message-tool-policy.test.ts src/cron/isolated-agent/run-fallback-policy.test.ts src/cron/isolated-agent/run.payload-fallbacks.test.ts src/agents/pi-embedded-runner/run/fallbacks.test.ts src/agents/agent-scope.test.ts src/cron/isolated-agent.model-formatting.test.ts src/cron/isolated-agent/run.cron-model-override-forwarding.test.ts src/agents/pi-embedded-runner/run/failover-observation.test.ts src/agents/pi-embedded-runner/run/failover-policy.test.tspnpm exec oxfmt --check --threads=1 CHANGELOG.md src/agents/agent-scope.ts src/agents/pi-embedded-runner/run.ts src/agents/pi-embedded-runner/run/fallbacks.ts src/agents/pi-embedded-runner/run/fallbacks.test.ts src/cron/isolated-agent.model-formatting.test.ts src/cron/isolated-agent/model-selection.ts src/cron/isolated-agent/run-execution.runtime.ts src/cron/isolated-agent/run-executor.ts src/cron/isolated-agent/run-fallback-policy.test.ts src/cron/isolated-agent/run-fallback-policy.ts src/cron/isolated-agent/run.payload-fallbacks.test.ts src/cron/isolated-agent/run.test-harness.ts src/cron/isolated-agent/run.ts src/cron/isolated-agent/run.message-tool-policy.test.tsnode scripts/run-oxlint.mjs CHANGELOG.md src/agents/agent-scope.ts src/agents/pi-embedded-runner/run.ts src/agents/pi-embedded-runner/run/fallbacks.ts src/agents/pi-embedded-runner/run/fallbacks.test.ts src/cron/isolated-agent.model-formatting.test.ts src/cron/isolated-agent/model-selection.ts src/cron/isolated-agent/run-execution.runtime.ts src/cron/isolated-agent/run-executor.ts src/cron/isolated-agent/run-fallback-policy.test.ts src/cron/isolated-agent/run-fallback-policy.ts src/cron/isolated-agent/run.payload-fallbacks.test.ts src/cron/isolated-agent/run.test-harness.ts src/cron/isolated-agent/run.ts src/cron/isolated-agent/run.message-tool-policy.test.tsgit diff --check/Users/steipete/Projects/agent-scripts/skills/codex-review/scripts/codex-review --mode localBehavior addressed: isolated cron
agentTurnruns that selectagents.defaults.subagents.modelor per-agentsubagents.modelnow use that model config's fallback list instead of silently falling back to the main agent model policy.Real environment tested: local OpenClaw checkout with mocked cron/embedded-runner regression tests.
Exact steps or command run after this patch: focused Vitest command above, oxfmt check, oxlint, git diff check, and codex-review local pass.
Evidence after fix: regression tests assert subagent fallback lists reach
runWithModelFallbackandrunEmbeddedPiAgent.modelFallbacksOverride, while hook/payload/session/agent-primary paths stay isolated.Observed result after fix: focused suite passed with 11 test files and 179 tests; codex-review finished clean with no accepted/actionable findings.
What was not tested: live scheduled cron run against a real provider timeout; this PR covers the model/fallback routing contract through focused regression tests.