Repository navigation
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4203909c6c
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| const configuredFallbacks = hasAgentModelFallbacksField(configuredModel) | ||
| ? resolveAgentModelFallbackValues(configuredModel) | ||
| : resolveAgentModelFallbacksFromModelsValue(configuredModel) | ||
| ? resolveCatalogFallbacks() | ||
| : []; |
There was a problem hiding this comment.
Keep fallbackConfigured in sync with catalog fallbacks
This new branch derives fallback candidates when fallbacksFromModels is enabled, but the embedded runner still decides whether model failover is enabled via hasConfiguredModelFallbacks (src/agents/agent-scope.ts:245-252), which only looks at explicit fallbacks arrays. resolveRunFailoverDecision then gates fallback_model on that stale flag (src/agents/pi-embedded-runner/run/failover-policy.ts:109-153), so assistant/retry-limit failures can be surfaced instead of escalating to the next derived catalog candidate. In practice, users who enable fallbacksFromModels can still get stuck on the primary model in common rate-limit/overload scenarios.
Useful? React with 👍 / 👎.
Greptile SummaryThis PR adds an opt-in Key issues found:
Confidence Score: 2/5Not safe to merge as-is — The core fallback derivation logic is correct and well-tested. However,
|
|
Thanks for the contribution. This PR still needs the requested real-behavior proof, and the branch has been idle since that ask. Close this stalled external feature PR: it has had no head commit since April 5, 2026, has been awaiting real-behavior proof since May 19, 2026, and remains dirty while a concrete embedded-runner failover gap is unresolved. So I’m closing this for now to keep the review queue honest. Please reopen or open a fresh PR with real-behavior proof (a live run, logs, or a reproducible validation transcript) and it will be reviewed again. Review detailsBest possible solution: If maintainers want catalog-derived fallbacks, restart from current Do we have a high-confidence way to reproduce the issue? No high-confidence live reproduction is provided. The source and recorded review make the candidate-resolution path clear, but the PR contains only unit-test claims rather than a current runtime failover trace. Is this the best way to solve the issue? No. The requested opt-in can be a reasonable direction, but this branch does not synchronize the embedded-runner failover decision and lacks current-main real behavior proof for the changed provider-selection path. Security review: Security review cleared: The diff adds configuration parsing and fallback selection only; no new secret handling, network execution, dependency, workflow, or supply-chain surface is evident. AGENTS.md: unclear because the file could not be read completely. What I checked:
Likely related people:
Codex review notes: model internal, reasoning high; reviewed against faf3dbdda833. |
|
ClawSweeper PR egg 🎁 Pass real behavior proof to wake the egg and unlock a hatchable treat. Where did the egg go?
|
|
This pull request has been automatically marked as stale due to inactivity. |
|
This pull request has been automatically marked as stale due to inactivity. |
|
ClawSweeper applied the proposed close for this PR.
|
Summary
agents.defaults.model.fallbacks, so operators who keep multiple models inagents.defaults.modelsstill have to duplicate that ordered list manually.fallbacks, which is easy to miss and easy to drift.agents.defaults.model.fallbacksFromModels: truethat derives fallback candidates fromagents.defaults.modelsin config order when explicitfallbacksare omitted.fallbacks/fallbacks: [].Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
Root Cause (if applicable)
fallbacksOverrideoragents.defaults.model.fallbacks).agents.defaults.modelsremained allowlist/catalog-only, so keeping multiple configured models there did not influence failover.agents.defaults.models, so the duplication requirement was easy to miss.Regression Test Plan (if applicable)
src/agents/model-fallback.test.tsagents.defaults.modelsonly whenfallbacksFromModels: true, keep explicitfallbacksprecedence, and keepfallbacks: []as an intentional disable.runWithModelFallbackunit coverage already covers explicit fallback ordering and allowlist behavior.User-visible / Behavior Changes
agents.defaults.model.fallbacksFromModels: truefallbacksare omitted, OpenClaw derives fallback candidates fromagents.defaults.modelsin config order, excluding the configured primary.fallbacksstill win, andfallbacks: []still disables fallback.Diagram (if applicable)
Security Impact (required)
Yes, explain risk + mitigation:Repro + Verification
Environment
agents.defaults.model.primary,agents.defaults.model.fallbacksFromModels,agents.defaults.modelsSteps
agents.defaults.models.agents.defaults.model.fallbacksFromModels: truewithout setting explicitfallbacks.Expected
agents.defaults.modelsis attempted.Actual
Evidence
Human Verification (required)
fallbacksstill override catalog derivationfallbacks: []still disables fallbackbuild/checkgreen, because latestmainis already red on unrelatedskills/SourceInfoandprovider-transport-fetchissuessrc/agents/model-fallback.test.tsrun without unrelated unhandled plugin-registration/import noise on currentmainReview Conversations
If a bot review conversation is addressed by this PR, resolve that conversation yourself. Do not leave bot review conversation cleanup for maintainers.
Compatibility / Migration
Risks and Mitigations
fallbacksFromModels: true) and docs clarify that explicitfallbacksstill take precedence.fallbacks: []remains the escape hatch to disable fallback.Validation notes
pnpm exec vitest run src/agents/model-fallback.test.ts -t 'derives fallbacks from configured models when enabled|prefers explicit fallbacks over configured model derivation|treats explicit empty fallbacks as disabling configured model derivation'mainstill emits unrelated unhandled plugin registration/import errors during this filepnpm exec vitest run src/config/schema.base.generated.test.ts2files /6tests)pnpm buildsrc/agents/provider-transport-fetch.ts,src/agents/skills/local-loader.ts,src/agents/skills/skill-contract.tspnpm checkskills/SourceInfoerrors