fix(status): use selected model for usage#93348
Conversation
|
Thanks for the context here. I swept through the related work, and this is now duplicate or superseded. Close as superseded: #93384 is the better open landing path for the same linked Canonical path: Use #93384 as the single landing path for the linked So I’m closing this here and keeping the remaining discussion on #93384. Review detailsBest possible solution: Use #93384 as the single landing path for the linked Do we have a high-confidence way to reproduce the issue? Yes at source level. The linked live report on v2026.6.6 shows OpenAI selected while DeepSeek usage is rendered, and current main's Is this the best way to solve the issue? No. This PR is a plausible narrow mitigation, but #93384 is a better fix because it moves selected-provider parsing into the shared resolver boundary and covers usage, auth, context, and status-message lookup. Security review: Security review cleared: The diff only changes TypeScript status rendering logic and a colocated test, with no dependency, workflow, package, secret, or privileged execution change. AGENTS.md: found and applied where relevant. What I checked:
Likely related people:
Codex review notes: model internal, reasoning high; reviewed against 32af1c069727. |
Summary
/statususage probes follow a user-selected session model instead of a stale active runtime snapshot.Fixes #93322.
Root Cause
buildStatusTextchose the usage provider from the active runtime provider whenever the active runtime model differed from the selected model. After/model, the stored runtime snapshot can still describe the previous/default model until a later turn refreshes it, so/statuscould show the selected OpenAI model while querying and displaying DeepSeek usage.Real behavior proof
openai/gpt-5.5, status usage must use the selected OpenAI profile even when the persisted active runtime snapshot still saysdeepseek/deepseek-v4-flash.codex/fix-status-selected-usage-93322, commit9229111, with isolatedOPENCLAW_STATE_DIRand a local provider usage responder returning an OpenAI WHAM payload. No secrets or live account data were used.node --import tsx --input-type=modulewith a focused runtime probe that importssrc/status/status-text.ts, persists a token auth profile in the isolated state dir, renders/status, and renders the samebuildStatusTextpath thatsession_statuscalls fromsrc/agents/tools/session-status-tool.ts:883.openai/gpt-5.5andUsage: 5h 91% left; neither output rendered the stale DeepSeekBalance ¥22.75, and the provider usage endpoint was called twice for the selected usage path.Verification
node scripts/run-vitest.mjs src/auto-reply/reply/commands-status.test.ts -- --reporter=verbosepnpm format:check -- src/status/status-text.ts src/auto-reply/reply/commands-status.test.tsgit diff --check -- src/status/status-text.ts src/auto-reply/reply/commands-status.test.ts.agents/skills/autoreview/scripts/autoreview --mode local; blocked before review by local Codex CLI config error:unknown variant default, expected fast or flex in service_tier.