Skip to content

fix(status): show actual routed model in /status after fallback#26876

Closed
xinhuagu wants to merge 1 commit into
openclaw:mainfrom
xinhuagu:fix/status-shows-routed-fallback-model-23830
Closed

fix(status): show actual routed model in /status after fallback#26876
xinhuagu wants to merge 1 commit into
openclaw:mainfrom
xinhuagu:fix/status-shows-routed-fallback-model-23830

Conversation

@xinhuagu

@xinhuagu xinhuagu commented Feb 25, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes /status showing only the configured model after runtime fallback by using the latest transcript provider/model metadata as runtime truth.

Closes #23830

What changed

  • /status now enables transcript-tail inspection (includeTranscriptUsage: true) so it can resolve runtime model metadata.
  • readUsageFromSessionLog now captures both provider and model from transcript lines and normalizes them into a full provider/model ref.
  • buildStatusMessage now applies transcript-derived runtime model even when sessionEntry.model exists, so fallback routing is reflected in status output.
  • Added regression test: verifies selected model remains configured model while fallback line shows routed runtime model from transcript metadata.

Test

  • pnpm -s vitest src/auto-reply/status.test.ts

Greptile Summary

Fixed /status command to display the actual routed model after runtime fallback by enabling transcript inspection and using provider/model metadata from the transcript as the source of truth.

  • Enabled includeTranscriptUsage: true in commands-status.ts so transcript metadata is available
  • Updated readUsageFromSessionLog to capture both provider and model from transcript lines and normalize them into a full provider/model reference
  • Changed logic to apply transcript-derived runtime model even when session entry model exists, ensuring fallback routing is reflected
  • Added comprehensive test coverage verifying the fallback model display
  • Added security fix for GitHub Copilot token cache to validate tokens belong to the requesting account by storing and checking SHA-256 hash of the GitHub token

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • The changes are well-tested with comprehensive test coverage including regression tests, follow established patterns in the codebase, and include a security improvement for the Copilot token cache. The logic changes are straightforward and align with the PR's stated goal of showing actual routed models after fallback.
  • No files require special attention

Last reviewed commit: 6e4b502

@bmendonca3

Copy link
Copy Markdown
Contributor

@xinhuagu The /status fallback-model fix looks useful, but this PR currently includes unrelated Copilot cache changes as well (src/providers/github-copilot-token.ts + tests, and related commits).

Could we split this into focused PRs (status fix vs Copilot cache hardening)? It would make review, regression triage, and rollback safer.

@xinhuagu

Copy link
Copy Markdown
Contributor Author

@bmendonca3 Done — I removed the unrelated Copilot cache changes from this PR and pushed an update. #26876 is now scoped to the /status routed-model fix (plus its status regression coverage) only.

@xinhuagu
xinhuagu force-pushed the fix/status-shows-routed-fallback-model-23830 branch from 5e371b9 to 221c95f Compare February 28, 2026 08:46
@xinhuagu

Copy link
Copy Markdown
Contributor Author

Status note: latest remaining red appears to be the shared Windows Feishu proxy test path, which looks unrelated to this /status routed-model fix. Keeping this PR up to date while waiting for green upstream test state.

@xinhuagu
xinhuagu force-pushed the fix/status-shows-routed-fallback-model-23830 branch 2 times, most recently from fd0c910 to ef17d47 Compare February 28, 2026 21:22
@xinhuagu
xinhuagu force-pushed the fix/status-shows-routed-fallback-model-23830 branch from ef17d47 to 72e21c2 Compare March 5, 2026 18:32
@xinhuagu

xinhuagu commented Mar 7, 2026

Copy link
Copy Markdown
Contributor Author

Closing — #23866 addressed the same issue earlier.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: /status displays session-configured model instead of actual routed model after fallback

3 participants