fix(status): show configured fallback models in /status output#33111
fix(status): show configured fallback models in /status output#33111altaywtf merged 6 commits intoopenclaw:mainfrom
Conversation
Greptile SummaryThis PR adds a Confidence Score: 5/5Safe to merge — all remaining findings are P2 or lower and do not affect correctness. The logic is straightforward: read model.fallbacks from the resolved agent config and format it. The three-tier inheritance (agent override → agent has no override, inherit defaults → empty array disables) is handled correctly and covered by targeted tests. The fallback state display is additive and does not change any existing behavior. No files require special attention.
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 39aabbab2a
ℹ️ 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 modelConfig = args.agent?.model; | ||
| if (typeof modelConfig === "object" && modelConfig && Array.isArray(modelConfig.fallbacks)) { | ||
| return modelConfig.fallbacks; |
There was a problem hiding this comment.
Derive displayed fallbacks from effective agent settings
Reading modelConfig.fallbacks from args.agent here causes /status to report the wrong fallback list for non-default agents, because both status callers currently construct args.agent from cfg.agents.defaults (src/auto-reply/reply/commands-status.ts:162-170, src/agents/tools/session-status-tool.ts:351-356). If an agent overrides model.fallbacks (or sets [] to disable global fallbacks), the new line will still show default fallbacks, so users get incorrect configuration feedback even though runtime fallback resolution honors per-agent overrides.
Useful? React with 👍 / 👎.
|
关于 CI 失败的说明 当前 CI 中的失败看起来是已知的 flaky tests,而非本 PR 代码改动造成: 失败的 checks:
验证:
建议维护者可以重跑失败的 checks,或者考虑在已知 flaky 的情况下 review 合并。 cc @maintainers |
f86fe90 to
35a76cc
Compare
dbef32f to
8e15c41
Compare
|
@greptileai review |
There was a problem hiding this comment.
Pull request overview
Updates the /status command (and shared status card output) to always display the configured model fallback chain, not only the active fallback when a failover happens. This improves visibility into agents.defaults.model.fallbacks and per-agent fallback overrides.
Changes:
- Add a new “🔄 Fallbacks: …” line in
buildStatusMessage()when fallbacks are configured. - Wire per-agent fallback overrides into
/statusconstruction so the displayed list matches the effective agent configuration. - Add/extend tests to cover configured fallbacks display, inheritance, and explicit disabling.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/auto-reply/status.ts | Adds rendering of configured fallback models into the status message output. |
| src/auto-reply/status.test.ts | Adds unit tests asserting the configured fallbacks line appears/omits correctly. |
| src/auto-reply/reply/commands-status.ts | Threads per-agent fallback override into the status message’s agent model config. |
| src/auto-reply/reply/commands-status.thinking-default.test.ts | Adds integration-style tests verifying per-agent fallback overrides/inheritance in status reply output. |
| CHANGELOG.md | Documents the behavior change for /status and shared status cards. |
| // Show configured fallback models (from agent model config) | ||
| const configuredFallbacks = (() => { | ||
| const modelConfig = args.agent?.model; | ||
| if (typeof modelConfig === "object" && modelConfig && Array.isArray(modelConfig.fallbacks)) { | ||
| return modelConfig.fallbacks; | ||
| } | ||
| return undefined; | ||
| })(); | ||
| const configuredFallbacksLine = configuredFallbacks?.length | ||
| ? `🔄 Fallbacks: ${configuredFallbacks.join(", ")}` | ||
| : null; |
There was a problem hiding this comment.
The configured fallback list is displayed verbatim via configuredFallbacks.join(", "). Since AgentModelSchema allows arbitrary strings (including whitespace/empty strings and duplicates), /status can show blank entries or repeated models (e.g., Fallbacks: , openai/gpt-4.1, openai/gpt-4.1). Consider normalizing the list before rendering (trim, drop empty, de-dupe case-insensitively) to keep status output clean and consistent with other places that normalize fallback lists (e.g., gateway agent listing).
Fixes openclaw#33099 Previously, the /status command only showed fallback models when they were actively being used. Now it also displays configured fallback models from agents.defaults.model.fallbacks so users can verify their setup at a glance. - Added configuredFallbacksLine to show fallback models from config - Added tests for the new functionality
PR Review Feedback: - Use resolveAgentModelFallbacksOverride() to get agent-specific fallbacks - Fixes incorrect fallback display for non-default agents - Agent can now set fallbacks: [] to disable global fallbacks
8e15c41 to
5e590aa
Compare
|
Merged via squash.
Thanks @AnCoSONG! |
Fixes #33099
Previously, the /status command only showed fallback models when they were actively being used (i.e., when the primary model failed and a fallback was activated). This made it hard for users to verify their fallback configuration without checking the raw config.
Changes
Example Output
With config:
"""json
"model": {
"primary": "anthropic/claude-opus-4-6",
"fallbacks": ["google/gemini-2.5-flash"]
}
"""
Status now shows:
""\