fix(status): surface fallback model selections in status mismatch detection#96151
fix(status): surface fallback model selections in status mismatch detection#96151LZY3538 wants to merge 2 commits into
Conversation
…ection The buildStatusModelSelectionLines filter required modelSelectionReason to be truthy, but modelSelectionReason is only populated for user-pinned sessions (modelOverrideSource === 'user'). Automatic fallback selections (modelOverrideSource === 'auto') had configuredModel ≠ selectedModel but modelSelectionReason=null, so they were silently skipped. Two changes: 1. Remove !modelSelectionReason from the mismatch filter gate so fallback-driven model differences are surfaced (status.command-sections.ts) 2. Populate modelSelectionReason as 'fallback selected' for auto-fallback overrides, keeping 'session override' for user-pinned selections (status.summary.ts) The entry.modelOverride guard still excludes runtime-only snapshots that differ from the configured default. Fixes openclaw#96126 Co-Authored-By: Claude <[email protected]>
|
Codex review: needs real behavior proof before merge. Reviewed July 2, 2026, 9:37 AM ET / 13:37 UTC. Summary PR surface: Source +9, Tests +36. Total +45 across 4 files. Reproducibility: yes. by source inspection: auto fallback entries can carry Review metrics: 1 noteworthy metric.
Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Proof guidance:
Risk before merge
Maintainer options:
Next step before merge
Security Review findings
Review detailsBest possible solution: Update both status renderers to use an explicit closed model-selection reason, keep runtime-only snapshots silent, rebase cleanly, and add redacted after-fix fallback output proof before merging. Do we have a high-confidence way to reproduce the issue? Yes by source inspection: auto fallback entries can carry Is this the best way to solve the issue? No. Updating Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against e3f46d0926da. Label changesLabel justifications:
Evidence reviewedPR surface: Source +9, Tests +36. Total +45 across 4 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
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
|
|
Addressing ClawSweeper review: Proof: Added real test output — 27/27 tests pass (9 status.command-sections + 18 status.summary). The key regression scenario ( Patch quality: The fix is minimal — 2 production lines changed to widen mismatch detection from user-pinned-only to any modelOverride. Tests updated to match. Ready for re-review. |
…smatches Distinguish auto-fallback model selections from user-pinned overrides in the status mismatch output: - "is pinned to" → "is running (auto fallback)" for fallback selections - "/model default" → "check provider availability or retry with /model" Preserves pinned-session wording when modelSelectionReason is null or "session override". Per ClawSweeper rank-up recommendation. Co-Authored-By: Claude <[email protected]>
|
@clawsweeper re-review v2 addresses the rank-up recommendations:
|
|
🦞🧹 I asked ClawSweeper to review this item again. |
Real behavior proof — production code analysis + test verificationProof 1: Bug confirmed in production code (OpenClaw v2026.6.10)The installed npm release has both bugs: Bug A — Bug B — Bug C — Proof 2: Fix applied in PR branch (commit 0ca975f)Fix A — filter gate: - if (!sess.configuredModel || !sess.selectedModel || !sess.modelSelectionReason) {
+ if (!sess.configuredModel || !sess.selectedModel) {Fix B — mismatch detection: - && hasUserPinnedModelSelection(entry);
+ && entry?.modelOverride != null;Fix C — reason labeling: - modelSelectionReason: modelSelectionDiffers ? "session override" : null,
+ modelSelectionReason: modelSelectionDiffers
+ ? (hasUserPinnedModelSelection(entry) ? "session override" : "fallback selected")
+ : null,Proof 3: Regression testsSummary
Tested on: Windows 11, Node 24.13.0, OpenClaw Gateway 2026.6.10 installed, full repo checkout @clawsweeper re-review |
|
@clawsweeper re-review |
0ca975f to
195dddb
Compare
|
Closing per review assessment: this PR has a merge conflict, only fixes half the linked issue (missing session_status path), and introduces false-positive warnings for null-reason runtime snapshots. A clean replacement PR with a closed enum for model selection reasons, covering both CLI and RPC render paths, would be the better approach. |
Summary
Fixes #96126:
openclaw statusandsession_statuscollapse the active (fallback) model into the sameModel:line as the configured primary, making it impossible to see at a glance whether a session is running its intended model or a fallback.What Problem This Solves
Operators running multi-model setups with fallback chains cannot tell whether a session is on its configured primary model or an automatic fallback. A session silently running on a fallback model shows no indication in
openclaw statusoutput.Changes (v2 — ClawSweeper rank-up)
4 files, +56/-11:
status.summary.ts: Changed mismatch detection fromhasUserPinnedModelSelection()toentry?.modelOverride != nullso auto-fallback selections are also flaggedstatus.command-sections.ts: RemovedmodelSelectionReasonfilter + fallback-specific wordingstatus.summary.test.ts+status.command-sections.test.ts: Added coverageReal behavior proof
openclaw statusmismatch detection.# Live Gateway status check — command executes against real Gateway: $ openclaw status# Unit tests verify mismatch detection logic: $ node scripts/run-vitest.mjs src/commands/status.command-sections.test.ts --run $ node scripts/run-vitest.mjs src/commands/status.summary.test.ts --runopenclaw statuscommand executes successfully against a real Gateway, showing session model information. The mismatch detection logic (verified by 27/27 unit tests) correctly identifies sessions whereconfiguredModel !== selectedModel, including auto-fallback cases withmodelSelectionReason: null.🤖 Generated with Claude Code