Skip to content

Fix cost summary style across provider menu cards - #2979

Merged
steipete merged 2 commits into
mainfrom
fix/2976-cost-summary-style
Aug 16, 2026
Merged

Fix cost summary style across provider menu cards#2979
steipete merged 2 commits into
mainfrom
fix/2976-cost-summary-style

Conversation

@steipete

Copy link
Copy Markdown
Owner

Fixes #2976.

Summary

  • Apply the Cost summary display style through one shared menu-card input instead of only the local token-cost dashboard path.
  • Hide provider-native inline spend summaries and descriptor-marked historical cost/token sections when the style is Submenu only, while preserving quota and balance-only details.
  • Keep provider detail panes fully diagnostic, and gate OpenAI API/Mistral usage submenus with the same display-style policy.
  • Add focused z.ai model regressions for Submenu only and Inline only, plus update affected provider-summary fixtures.

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 — pass
  • swift test --filter ZaiMenuCardTests — pass (post-merge, 3 tests)
  • swift test --filter ProviderArchitectureGatekeeperTests — pass after updating shifted anchors
  • Focused Groq, OpenAI API, Mistral, ai&, Claude Admin API, LiteLLM, OpenCode, MiniMax, and shared menu-card model suites — pass
  • make 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.

@clawsweeper

clawsweeper Bot commented Aug 16, 2026

Copy link
Copy Markdown

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@clawsweeper

clawsweeper Bot commented Aug 16, 2026

Copy link
Copy Markdown

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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

@steipete
steipete merged commit 361c9d6 into main Aug 16, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cost summary style "Submenu only" not respected for all providers

1 participant