Skip to content

Show selected-provider spend in Overview - #3023

Merged
steipete merged 1 commit into
steipete:mainfrom
Chipagosfinest:agent/multi-provider-overview-spend
Aug 18, 2026
Merged

Show selected-provider spend in Overview#3023
steipete merged 1 commit into
steipete:mainfrom
Chipagosfinest:agent/multi-provider-overview-spend

Conversation

@Chipagosfinest

Copy link
Copy Markdown
Contributor

Summary

  • add a compact Usage & Spend summary above the provider cards in Overview
  • scope spend and token totals to the providers currently shown in Overview
  • make incomplete provider coverage explicit and keep distinct currencies separate
  • include focused summary tests and a reproducible UI proof image

Scope

This is the focused Overview slice extracted from #2759 and rebuilt on current main. It preserves the existing six-provider Overview fallback and does not change provider refresh, Settings defaults, share/export, or token allocation.

Current main already contains the newer All Time, partial-total, project-model, and project-panel foundations, so none of those are duplicated here.

Verification

  • swift test --filter OverviewSpendSummaryTests
  • CODEXBAR_SPEND_PROOF_DIR=.github/pr-proof swift test --filter SpendDashboardScreenshotRenderTests
  • make check

Overview spend summary

@clawsweeper

clawsweeper Bot commented Aug 17, 2026

Copy link
Copy Markdown

🦞👀
ClawSweeper picked this up.

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

@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: 8e7340b2b1

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +581 to +582
let spendModel = self.overviewSpendDashboardModel(providers: overviewProviders)
if !spendModel.groups.isEmpty {

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 Honor the submenu-only cost preference

When cost tracking is enabled but the user selects Cost summaries → Submenu only, this path still unconditionally inserts OverviewSpendSummaryCardView directly into the main Overview menu. The existing preference explicitly suppresses main-menu summaries through costSummaryShowsInline(for:), so the new overview summary should also be gated by the inline display preference.

Useful? React with 👍 / 👎.

@clawsweeper clawsweeper Bot added merge-risk: 🚨 compatibility 🚨 Merging this PR could break existing users, config, migrations, defaults, or upgrades. P2 Normal priority bug or improvement with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Aug 17, 2026
@clawsweeper

clawsweeper Bot commented Aug 17, 2026

Copy link
Copy Markdown

Codex review: needs real behavior proof before merge. Reviewed August 17, 2026, 7:16 PM ET / 23:16 UTC.

ClawSweeper review

What this changes

The PR adds a compact Usage & Spend card above Overview provider rows, scoped to selected providers and showing partial coverage and separate currencies.

Merge readiness

Blocked until real behavior proof from a real setup is added - 7 items remain

Keep open: the new card bypasses the existing Cost summaries display preference, so users who chose submenu-only or off will still receive an inline Overview summary. The attached image is a component-render test rather than a real Overview-menu run.

Priority: P2
Reviewed head: 8e7340b2b1134c6720c72b2b7053e5433dc706d5

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) The feature has focused implementation and component coverage, but a saved-preference regression and lack of real menu proof block merge readiness.
Proof confidence 🦪 silver shellfish (2/6) Needs real behavior proof before merge: The attached image is a SwiftUI component render produced by an opt-in XCTest path; add a redacted after-fix capture of the actual Overview menu, including the relevant display-style behavior. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Patch quality 🦪 silver shellfish (2/6) 1 actionable review finding remain.

Verification

Check Result Evidence
Real behavior Needs proof Needs real behavior proof before merge: The attached image is a SwiftUI component render produced by an opt-in XCTest path; add a redacted after-fix capture of the actual Overview menu, including the relevant display-style behavior. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Evidence reviewed 4 items Existing preference contract: The current settings helper requires both effective cost usage and an inline display style before provider cost summaries appear inline; submenu-only and off intentionally return false.
Preference bypass in patch: The new summary is inserted whenever it has groups, without consulting the inline display-style preference.
Behavior provenance: The existing preference behavior appears to date to the recent commit explicitly titled “fix: honor cost summary style across providers.”.
Findings 1 actionable finding [P1] Honor the cost-summary display preference
Security None None.

How this fits together

CodexBar builds the macOS menu-bar Overview from configured usage providers and their stored token snapshots. This change aggregates those snapshots into a spend and token card before the provider rows.

flowchart LR
A[Configured providers] --> B[Overview selection]
B --> C[Stored usage snapshots]
C --> D[Spend summary calculation]
D --> E[Overview menu card]
B --> F[Provider rows]
Loading

Before merge

  • Add real behavior proof - Needs real behavior proof before merge: The attached image is a SwiftUI component render produced by an opt-in XCTest path; add a redacted after-fix capture of the actual Overview menu, including the relevant display-style behavior. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
  • Honor the cost-summary display preference (P1) - Gate this insertion with the existing inline-summary policy. The current helper returns false for both submenu-only and off, but this path adds the card whenever groups exist, overriding a saved user choice. A focused test should cover those two modes.
  • Resolve merge risk (P1) - Merging as written overrides existing submenu-only and off Cost summaries choices by showing the new card inline.
  • Resolve merge risk (P1) - The test-rendered image does not establish after-fix behavior in a configured Overview menu or cover the preference boundary.
  • Complete next step (P2) - The contributor must supply real menu behavior proof after fixing the preference regression; automation cannot establish that contributor-side proof.
  • Improve patch quality - Gate the card through the existing inline-summary preference and cover submenu-only/off.
  • Improve patch quality - Attach a redacted after-fix capture of the configured Overview menu; update the PR body to trigger a fresh review or ask a maintainer to comment @clawsweeper re-review.

Findings

  • [P1] Honor the cost-summary display preference — Sources/CodexBar/StatusItemController+Menu.swift:581-582
Agent review details

Security

None.

Review metrics

Metric Value Why it matters
Code and test delta production +147, tests +95, 1 proof image The feature is focused, but its menu insertion must preserve the existing persisted display-style contract.

Merge-risk options

Maintainer options:

  1. Preserve the saved display choice (recommended)
    Use the existing inline-summary decision path for the Overview card and verify that submenu-only and off do not add it.

Technical review

Best possible solution:

Gate the Overview card through the established inline-summary policy, add focused coverage for inline versus submenu-only/off, and provide a redacted live Overview-menu capture after the fix.

Do we have a high-confidence way to reproduce the issue?

Yes: with cost tracking enabled and Cost summaries set to submenu-only or off, the patched insertion at line 581 still adds the inline card because it never checks the display-style policy.

Is this the best way to solve the issue?

No: the card should reuse the established inline-summary gate rather than introducing a second path that overrides the saved preference.

Full review comments:

  • [P1] Honor the cost-summary display preference — Sources/CodexBar/StatusItemController+Menu.swift:581-582
    Gate this insertion with the existing inline-summary policy. The current helper returns false for both submenu-only and off, but this path adds the card whenever groups exist, overriding a saved user choice. A focused test should cover those two modes.
    Confidence: 0.99

Overall correctness: patch is incorrect
Overall confidence: 0.99

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against f7723d33a169.

Labels

Label changes:

  • add P2: This is a bounded user-settings compatibility defect in an otherwise focused Overview feature.
  • add merge-risk: 🚨 compatibility: The patch causes users’ saved submenu-only or off summary display choices to stop being honored.
  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🦪 silver shellfish.
  • add status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The attached image is a SwiftUI component render produced by an opt-in XCTest path; add a redacted after-fix capture of the actual Overview menu, including the relevant display-style behavior. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Label justifications:

  • P2: This is a bounded user-settings compatibility defect in an otherwise focused Overview feature.
  • merge-risk: 🚨 compatibility: The patch causes users’ saved submenu-only or off summary display choices to stop being honored.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🦪 silver shellfish.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The attached image is a SwiftUI component render produced by an opt-in XCTest path; add a redacted after-fix capture of the actual Overview menu, including the relevant display-style behavior. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Evidence

What I checked:

Likely related people:

  • steipete: Authored the current cost-summary display-style fix and is the dominant recent contributor across the menu and settings surfaces. (role: recent preference-behavior author; confidence: high; commits: 61c7e1ce821a, dc3ea3206c70; files: Sources/CodexBar/SettingsStore+TokenCost.swift, Sources/CodexBar/StatusItemController+Menu.swift)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
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.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@steipete
steipete merged commit 955f264 into steipete:main Aug 18, 2026
9 of 16 checks passed
@steipete

Copy link
Copy Markdown
Owner

Thanks @Chipagosfinest! This landed via #3027, which carried your commits onto current main (after the #3015#3019 spend stack reshaped the same surfaces), reconciled the semantics — partial totals render with ~ and unpriced spend stays unavailable, matching the new coverage model — and refreshed the stale gatekeeper anchors that were failing CI. The changelog credits you.

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

Labels

merge-risk: 🚨 compatibility 🚨 Merging this PR could break existing users, config, migrations, defaults, or upgrades. P2 Normal priority bug or improvement with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants