fix(agents): honor subagent cron fallbacks#82295
Conversation
|
Codex review: found issues before merge. Summary Reproducibility: yes. at source level. The linked failure is traceable through isolated cron fallback resolution and embedded failover state, and the PR diff shows a remaining resolver-order case that skips global subagent fallbacks when the parent agent has its own model. Real behavior proof Next step before merge Security Review findings
Review detailsBest possible solution: Use the current-main implementation as the baseline, then either close this stale protected branch as superseded or rebase it with fallback selection that preserves per-agent subagent, global subagent, then parent-agent model precedence. Do we have a high-confidence way to reproduce the issue? Yes, at source level. The linked failure is traceable through isolated cron fallback resolution and embedded failover state, and the PR diff shows a remaining resolver-order case that skips global subagent fallbacks when the parent agent has its own model. Is this the best way to solve the issue? No, not as-is. Threading the fallback override into cron and embedded runs is the right narrow direction, but this branch's shared resolver still lets the parent agent model shadow global subagent fallback defaults; current main has a safer guarded implementation to start from. Full review comments:
Overall correctness: patch is incorrect Acceptance criteria:
What I checked:
Likely related people:
Remaining risk / open question:
Codex review notes: model gpt-5.5, reasoning high; reviewed against e22a7e45a40a. |
757bd51 to
e632eab
Compare
|
Closing as superseded by current The #74985 behavior is already fixed on
Thank you. The branch here still has useful related refactor/test work, but the user-visible fix this PR targets is no longer open against main. |
Summary
Real behavior proof
Behavior addressed: #74985 isolated cron embedded runs with subagents.model.fallbacks now pass the fallback chain into model fallback execution and embedded failover state.
Real environment tested: local checkout, importing the real OpenClaw cron fallback resolver through the TS runtime loader.
Exact steps or command run after this patch: node --import tsx with a cron isolated agentTurn fixture that configures agents.defaults.subagents.model.fallbacks, then the same fixture with payload.model override; node scripts/run-vitest.mjs src/cron/isolated-agent.model-formatting.test.ts src/cron/isolated-agent/model-selection.test.ts src/cron/isolated-agent/run-fallback-policy.test.ts src/cron/isolated-agent/run.payload-fallbacks.test.ts src/agents/agent-scope.test.ts src/agents/pi-embedded-runner/run/failover-policy.test.ts; pnpm exec oxfmt --check --threads=1 CHANGELOG.md src/agents/agent-scope.ts src/agents/agent-scope.test.ts src/cron/isolated-agent.model-formatting.test.ts src/cron/isolated-agent/model-selection.ts src/cron/isolated-agent/run-model-selection.runtime.ts src/cron/isolated-agent/run.test-harness.ts src/cron/isolated-agent/run-fallback-policy.ts src/cron/isolated-agent/run-fallback-policy.test.ts src/cron/isolated-agent/run.payload-fallbacks.test.ts src/cron/isolated-agent/run-executor.ts src/agents/pi-embedded-runner/run.ts; git diff --check; codex-review --full-access.
Evidence after fix: Terminal output from the runtime resolver probe:
{ "isolated": [ "openai-codex/gpt-5.4", "zai/glm-5" ], "payloadOverride": [ "openai/gpt-5.4" ] }Focused Vitest also passed 6 files / 134 tests after rebase onto origin/main; oxfmt passed; git diff --check passed; codex-review clean after accepted fixups.
Observed result after fix: isolated cron agent turns resolve to the configured subagent fallback chain, payload model overrides use the configured default model fallback policy instead of subagent fallbacks, embedded runs receive modelFallbacksOverride, and metadata-only subagents.model falls through to the next selected model config.
What was not tested: live Kimi/provider timeout E2E.