Fix cost summary style across provider menu cards - #2979
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
ClawSweeper status: review started. I am starting a fresh review of this pull request: Fix cost summary style across provider menu cards This is item 1/1 in the current shard. Shard 0/1. This placeholder means the worker is alive and reading the current context. I will edit this same comment with the actual review when the claws are done clicking. Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e832eb1ec5
ℹ️ 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".
| snapshot: input.snapshot, | ||
| isRefreshing: input.isRefreshing, | ||
| tokenCostInlineDashboardEnabled: input.tokenCostInlineDashboardEnabled, | ||
| costSummaryInlineEnabled: input.costSummaryInlineEnabled, |
There was a problem hiding this comment.
Gate OpenAI API usage notes with the inline setting
When OpenAI Admin API data is present and the Cost summary setting is Off or Submenu only, the new flag removes inlineUsageDashboard, but the OpenAI usageNotesResolver ignores costSummaryInlineEnabled and still returns notes containing Today/7d costs and token totals. Because the card renders usageNotes whenever the dashboard is absent, this change replaces the chart with a textual inline cost summary instead of hiding inline cost data; suppress the OpenAI notes when this flag is false as well.
Useful? React with 👍 / 👎.
Fixes #2976.
Summary
Root cause
The card model had three cost-summary surfaces: the local token-cost dashboard, provider cost sections, and declarative provider detail sections. Only the first received the display-style setting. z.ai renders its hourly/daily token history through declarative provider details, so that path never consulted the setting. OpenAI API, Mistral, DeepSeek, Groq, MiniMax, Claude Admin API, and other provider-native spend paths had equivalent bypasses.
Affected providers
The shared policy now covers every inline cost-summary surface. Historical detail sections are declared by their provider descriptors for z.ai, DeepSeek, Groq, MiniMax, Claude Admin API, OpenAI API, and xAI. Provider-native dashboards such as OpenAI API and Mistral, plus spend-style provider-cost cards such as ai&, LiteLLM, OpenCode, Claude Admin API, and Mistral pay-as-you-go, use the same inline flag. Kimi and the Grok subscription provider were audited and do not currently expose one of these historical cost-summary sections.
Tests
make check— passswift test --filter ZaiMenuCardTests— pass (post-merge, 3 tests)swift test --filter ProviderArchitectureGatekeeperTests— pass after updating shifted anchorsmake test— 40/73 groups passed; group 41 timed out as a batch and the isolated unrelated Kiro PTY hard-stop test failed because its optional late-child PID file was absent. A test-only delay experiment was reverted after it exposed a separate persistent-child cleanup issue rather than a safe flake fix.Source-blind live menu validation was not run because it requires a configured z.ai account and live credential access; this task explicitly prohibits Keychain-prompting provider probes.