Skip to content

fix(status): surface auto-fallback model in status and session_status (#96126)#101337

Merged
steipete merged 3 commits into
openclaw:mainfrom
LZY3538:fix/status-fallback-model-display
Jul 7, 2026
Merged

fix(status): surface auto-fallback model in status and session_status (#96126)#101337
steipete merged 3 commits into
openclaw:mainfrom
LZY3538:fix/status-fallback-model-display

Conversation

@LZY3538

@LZY3538 LZY3538 commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes #96126. openclaw status and session_status now identify an active automatic model fallback without mistaking user-selected models, runtime snapshots, aliases, or configured subagent models for provider failover.

What Problem This Solves

Status output showed the active model but did not explain when automatic provider fallback selected it instead of the configured primary. That made a provider outage look like an unexplained configuration change.

Why This Change Was Made

Both status surfaces now carry a closed reason for a configured-versus-selected mismatch:

  • user selection: pinned session, with the existing /model default recovery action;
  • active automatic fallback: fallback selected, with provider-availability guidance;
  • ordinary runtime snapshot, runtime-equivalent alias, or configured subagent self-origin selection: no warning.

The maintainer repair adds a shared active-fallback predicate at the session-provenance owner. A configured subagent intentionally stores automatic self-origin metadata so cleanup preserves its configured model; only an effective selection that differs from that recorded origin is provider failover.

User Impact

  • openclaw status labels real fallback rows as auto fallback and suggests checking provider availability.
  • session_status shows the configured primary next to the live fallback model.
  • User-pinned model wording remains unchanged.
  • Configured subagent models remain normal configured selections, not fallback warnings.

Evidence

  • Sanitized AWS Crabbox cbx_5b68069a77a2, exact head fd30f4666d7d80284d623073a5a1f59864a349e7:
    • run_921884422a68: 39 focused tests passed across the provenance helper, CLI status summary/sections, and session_status.
    • run_dde974d8aa34: pnpm check:changed passed, including project type checks, lint/format guards, and dependency/import checks.
  • Fresh pre-commit autoreview: no accepted or actionable findings.
  • Focused regressions cover true automatic fallback, user pinning, runtime aliases, runtime-only snapshots, and configured-subagent self-origin state.

Co-authored-by: LZY3538 [email protected]

@clawsweeper

clawsweeper Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed July 7, 2026, 2:45 AM ET / 06:45 UTC.

Summary
The PR updates CLI status and session_status rendering/tests so auto-fallback model overrides are shown with fallback-specific wording instead of being hidden or labeled as user-pinned selections.

PR surface: Source +15, Tests +83. Total +98 across 6 files.

Reproducibility: yes. by source inspection: current main gates both CLI status and session_status mismatch copy on user-pinned selections, so an auto fallback override with a different selected model gets no fallback reason. I did not run a live fallback in this read-only review.

Review metrics: none identified.

Root-cause cluster
Relationship: fixed_by_candidate
Canonical: #96126
Summary: The linked issue is the canonical report for configured-versus-active fallback visibility, and this PR is the current candidate fix after the prior attempt was closed unmerged.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge readiness
Overall: 🧂 unranked krab
Proof: 🦪 silver shellfish
Patch quality: 🧂 unranked krab
Result: blocked until stronger real behavior proof is added.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • Narrow fallback detection so configured subagent automatic model selections are not labeled as provider fallback.
  • [P1] Add regression coverage for a configured subagent/default model selection with modelOverrideSource auto.
  • [P2] Add redacted real fallback proof for both openclaw status and session_status.

Proof guidance:

  • [P1] Needs stronger real behavior proof before merge: Insufficient: the PR body shows a normal live Gateway check and a simulated fallback snippet, but not an observed real fallback run for both CLI status and session_status; contributor action is still needed with redacted terminal/log/screenshot proof. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Risk before merge

  • [P2] Merging as-is can mislabel configured subagent automatic model selections as provider fallback in both CLI status and session_status, telling operators to check provider availability when no fallback happened.
  • [P2] The PR body now includes a normal live Gateway check and a simulated fallback snippet, but it still does not show an observed real fallback session through both changed surfaces.

Maintainer options:

  1. Narrow fallback detection before merge (recommended)
    Derive fallback wording from actual fallback state rather than every non-user modelOverride, add the configured-subagent regression case, and keep both status renderers aligned.
  2. Pause for replacement and proof
    If the contributor cannot update the predicate and provide observed fallback output, keep the canonical issue open for a narrower replacement PR.

Next step before merge

  • [P2] Contributor or human follow-up is needed because the branch needs a narrower fallback predicate and contributor-owned real behavior proof; ClawSweeper should not open a repair job while the external proof gate remains unmet.

Security
Cleared: Cleared: the diff only changes status rendering and focused tests, with no dependency, workflow, package, secret, permission, or code-execution surface changes.

Review findings

  • [P2] Distinguish fallback from automatic subagent model selection — src/commands/status.summary.ts:435
  • [P2] Avoid auto-fallback copy for non-fallback session_status state — src/status/status-message.ts:1077-1078
Review details

Best possible solution:

Use a shared explicit model-selection reason that only emits fallback wording for actual fallback state, leaves configured auto subagent selections silent or correctly labeled, and then require redacted real fallback proof for CLI status and session_status.

Do we have a high-confidence way to reproduce the issue?

Yes by source inspection: current main gates both CLI status and session_status mismatch copy on user-pinned selections, so an auto fallback override with a different selected model gets no fallback reason. I did not run a live fallback in this read-only review.

Is this the best way to solve the issue?

No. The patch is in the right surfaces, but the fallback heuristic is too broad because configured automatic subagent model selections also persist modelOverrideSource: "auto" and modelOverride.

Full review comments:

  • [P2] Distinguish fallback from automatic subagent model selection — src/commands/status.summary.ts:435
    This treats any differing session with modelOverride as a status warning, and then labels non-user-pinned entries as fallback selected. Configured subagent model selection also persists modelOverrideSource: "auto" and modelOverride, so a subagent using a configured/default model that differs from the agent primary can now be reported as provider fallback with check-provider guidance. This is a late discovery on the same head reviewed earlier; please derive the fallback reason from actual fallback state or add a shared closed reason helper.
    Confidence: 0.89
    Late finding: first raised on code an earlier review cycle already covered.
  • [P2] Avoid auto-fallback copy for non-fallback session_status state — src/status/status-message.ts:1077-1078
    The same broad predicate is used in session_status: any non-user-pinned entry with modelOverride is called auto fallback. Since subagent configured model selection can persist that shape without a provider failure, this can surface check provider in the status card for a normal configured automatic selection. This is a late discovery on code unchanged since the earlier reviewed head.
    Confidence: 0.87
    Late finding: first raised on code an earlier review cycle already covered.

Overall correctness: patch is incorrect
Overall confidence: 0.88

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against de152b1f65a6.

Label changes

Label changes:

  • add merge-risk: 🚨 other: Green CI does not settle whether the new fallback copy will be shown for configured automatic subagent model selections that are not provider fallback events.
  • add rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🦪 silver shellfish and patch quality is 🧂 unranked krab.
  • remove rating: 🦪 silver shellfish: Current PR rating is rating: 🧂 unranked krab, so this older rating label is no longer current.

Label justifications:

  • P2: The PR targets a real model fallback observability bug with limited blast radius, but the current patch can add misleading status guidance.
  • merge-risk: 🚨 other: Green CI does not settle whether the new fallback copy will be shown for configured automatic subagent model selections that are not provider fallback events.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🦪 silver shellfish and patch quality is 🧂 unranked krab.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs stronger real behavior proof before merge: Insufficient: the PR body shows a normal live Gateway check and a simulated fallback snippet, but not an observed real fallback run for both CLI status and session_status; contributor action is still needed with redacted terminal/log/screenshot proof. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Evidence reviewed

PR surface:

Source +15, Tests +83. Total +98 across 6 files.

View PR surface stats
Area Files Added Removed Net
Source 3 25 10 +15
Tests 3 85 2 +83
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 6 110 12 +98

What I checked:

  • Repository policy read: Root AGENTS.md was read fully; no scoped AGENTS.md matched src/commands or src/status, and the root review policy required checking sibling status/model-selection surfaces before verdict. (AGENTS.md:1, de152b1f65a6)
  • Current main suppresses auto fallback status reasons: Current main only sets modelSelectionReason when selected/configured models differ and hasUserPinnedModelSelection(entry) is true, so auto fallback entries remain silent. (src/commands/status.summary.ts:427, de152b1f65a6)
  • PR broadens CLI mismatch to any modelOverride: The PR head changes the CLI summary gate to entry?.modelOverride != null and labels every non-user-pinned differing model as fallback selected. (src/commands/status.summary.ts:435, e55a808b5419)
  • PR repeats the same predicate in session_status: The session_status renderer treats entry?.modelOverride plus not-user-pinned as auto fallback and emits check-provider guidance for that state. (src/status/status-message.ts:1077, e55a808b5419)
  • Subagent automatic model selection also writes modelOverrideSource auto: Configured subagent model selection sets modelOverrideSource to auto, and the spawn persistence path copies that model into modelOverride, so this sibling state can satisfy the PR's fallback predicate without being a provider fallback. (src/agents/subagent-spawn.ts:345, de152b1f65a6)
  • Fallback docs distinguish runtime fallback from user and legacy selections: The docs describe auto fallback override as runtime fallback state and separately document user and legacy overrides, supporting a narrower fallback-state derivation than any non-user modelOverride. Public docs: docs/concepts/model-failover.md. (docs/concepts/model-failover.md:50, de152b1f65a6)

Likely related people:

  • steipete: Recent history links this account to configured subagent model provenance and model fallback/session provenance docs used to distinguish automatic selection sources. (role: subagent and fallback-state history contributor; confidence: high; commits: d4a74b4993b9, 0e3f7a82fd12, 1dac68c0bbe7; files: src/agents/subagent-spawn-plan.ts, src/config/sessions/model-override-provenance.ts, docs/concepts/model-failover.md)
  • vincentkoc: Current-line blame in the shallow checkout and GitHub path history connect this account to the status summary and session_status rendering surfaces. (role: recent status surface contributor; confidence: medium; commits: bbd01c169e50, 2b75806197ab, aa3797c8d0d7; files: src/commands/status.summary.ts, src/status/status-message.ts)
  • Solvely-Colin: Merged path history shows compact /status pinned-model rendering work adjacent to the status-message override wording touched here. (role: pinned status rendering contributor; confidence: medium; commits: 3675c0141019; files: src/status/status-message.ts, src/auto-reply/status.test.ts)
  • zhangguiping-xydt: Recent path history changed status routing to session-selected models, adjacent to the configured-versus-selected model comparison under review. (role: recent status model routing contributor; confidence: medium; commits: bead84f0ee6e; files: src/status/status-message.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

How this review workflow works
  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.
Review history (3 earlier review cycles)
  • reviewed 2026-07-07T04:27:20.326Z sha 76324aa :: needs real behavior proof before merge. :: none
  • reviewed 2026-07-07T05:14:13.634Z sha e55a808 :: needs real behavior proof before merge. :: none
  • reviewed 2026-07-07T06:04:49.724Z sha e55a808 :: needs real behavior proof before merge. :: none

@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal backlog priority with limited blast radius. labels Jul 7, 2026
fix(status): surface auto-fallback model in status and session_status (openclaw#96126)

When a session falls back to an alternate model via auto-fallback
(modelOverrideSource: "auto"), both `openclaw status` and `session_status`
silently showed the active fallback model without indicating it differs
from the configured primary. The mismatch gate used
hasUserPinnedModelSelection() which returns false for auto-fallback.

- status.summary.ts: widen mismatch gate from hasUserPinnedModelSelection
  to entry?.modelOverride != null; emit distinct "fallback selected"
  reason alongside existing "session override"
- status.command-sections.ts: add fallback-specific wording ("auto
  fallback" / "check provider availability") while keeping the
  modelSelectionReason filter intact (no false-positive null-reason rows)
- status-message.ts: add sessionHasAutoFallback detection for the
  session_status RPC path; show "auto fallback" / "check provider" label
  instead of "pinned session" / "clear /model default"

Co-Authored-By: Claude <[email protected]>
@
@LZY3538
LZY3538 force-pushed the fix/status-fallback-model-display branch from 76324aa to e55a808 Compare July 7, 2026 04:41
@LZY3538

LZY3538 commented Jul 7, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper

@LZY3538

LZY3538 commented Jul 7, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Jul 7, 2026
@steipete steipete self-assigned this Jul 7, 2026
LZY3538 and others added 2 commits July 7, 2026 15:18
Replace entry?.modelOverride != null with
hasSessionAutoModelFallbackProvenance(entry) to avoid mislabeling
configured subagent automatic model selections as provider fallback.

Co-Authored-By: Claude <[email protected]>
@steipete
steipete merged commit a6352f9 into openclaw:main Jul 7, 2026
116 of 118 checks passed
@steipete

steipete commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 8, 2026
…openclaw#96126) (openclaw#101337)

* @
fix(status): surface auto-fallback model in status and session_status (openclaw#96126)

When a session falls back to an alternate model via auto-fallback
(modelOverrideSource: "auto"), both `openclaw status` and `session_status`
silently showed the active fallback model without indicating it differs
from the configured primary. The mismatch gate used
hasUserPinnedModelSelection() which returns false for auto-fallback.

- status.summary.ts: widen mismatch gate from hasUserPinnedModelSelection
  to entry?.modelOverride != null; emit distinct "fallback selected"
  reason alongside existing "session override"
- status.command-sections.ts: add fallback-specific wording ("auto
  fallback" / "check provider availability") while keeping the
  modelSelectionReason filter intact (no false-positive null-reason rows)
- status-message.ts: add sessionHasAutoFallback detection for the
  session_status RPC path; show "auto fallback" / "check provider" label
  instead of "pinned session" / "clear /model default"

Co-Authored-By: Claude <[email protected]>
@

* fix(status): narrow fallback detection to real fallback provenance

Replace entry?.modelOverride != null with
hasSessionAutoModelFallbackProvenance(entry) to avoid mislabeling
configured subagent automatic model selections as provider fallback.

Co-Authored-By: Claude <[email protected]>

* fix(status): distinguish configured models from fallback

Co-authored-by: LZY3538 <[email protected]>

---------

Co-authored-by: Claude <[email protected]>
Co-authored-by: Peter Steinberger <[email protected]>
giodl73-repo pushed a commit to giodl73-repo/openclaw that referenced this pull request Jul 8, 2026
…openclaw#96126) (openclaw#101337)

* @
fix(status): surface auto-fallback model in status and session_status (openclaw#96126)

When a session falls back to an alternate model via auto-fallback
(modelOverrideSource: "auto"), both `openclaw status` and `session_status`
silently showed the active fallback model without indicating it differs
from the configured primary. The mismatch gate used
hasUserPinnedModelSelection() which returns false for auto-fallback.

- status.summary.ts: widen mismatch gate from hasUserPinnedModelSelection
  to entry?.modelOverride != null; emit distinct "fallback selected"
  reason alongside existing "session override"
- status.command-sections.ts: add fallback-specific wording ("auto
  fallback" / "check provider availability") while keeping the
  modelSelectionReason filter intact (no false-positive null-reason rows)
- status-message.ts: add sessionHasAutoFallback detection for the
  session_status RPC path; show "auto fallback" / "check provider" label
  instead of "pinned session" / "clear /model default"

Co-Authored-By: Claude <[email protected]>
@

* fix(status): narrow fallback detection to real fallback provenance

Replace entry?.modelOverride != null with
hasSessionAutoModelFallbackProvenance(entry) to avoid mislabeling
configured subagent automatic model selections as provider fallback.

Co-Authored-By: Claude <[email protected]>

* fix(status): distinguish configured models from fallback

Co-authored-by: LZY3538 <[email protected]>

---------

Co-authored-by: Claude <[email protected]>
Co-authored-by: Peter Steinberger <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

commands Command implementations merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. P2 Normal backlog priority with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. size: M status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[openclaw status] Model field should distinguish base model from active fallback

2 participants