Make spend dashboard sessions, hourly chart, and daily counts readable - #3997
Yuxin-Qiao wants to merge 4 commits into
Conversation
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
|
Codex review: needs real behavior proof before merge. Reviewed September 25, 2026, 2:33 PM ET / 18:33 UTC (Revision 2). ClawSweeper reviewWhat this changesThe branch adds titles and project names to spend session rows, focuses the hourly chart on the newest active day, and displays known daily token and request counts as lower bounds when other providers omit them. Merge readiness⛔ Blocked before merge - 6 items remain This PR still addresses three real readability problems in Usage & Spend, and current main has not adopted them. The previous privacy finding remains at the current head: session titles and project names can appear while Hide Personal Info is enabled. The change to the hourly chart also needs an explicit product choice, and the PR has no after-fix native dashboard proof. Priority: P2 Review scores
Verification
How this fits togetherCodexBar scans local provider usage and builds spend summaries for its macOS Settings dashboard. The dashboard turns those summaries into session rows, daily counts, and hourly charts. flowchart LR
A[Local usage logs] --> B[Usage scanner]
B --> C[Provider snapshots]
C --> D[Spend dashboard model]
D --> E[Session rows]
D --> F[Daily ledger]
D --> G[Hourly chart]
Decision needed
Why: The branch deliberately changes an existing chart view, and the related owner-authored PR explicitly declined to adopt that behavior; code inspection cannot establish the intended product contract. Before merge
Findings
Agent review detailsSecurityNeeds attention: The new session identity text bypasses the dashboard's Hide Personal Info setting. Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Mask session titles, project names, subtitles, and tooltips under Hide Personal Info; then choose a discoverable hourly view that keeps the chart readable while preserving the intended history access, backed by native dashboard proof. Do we have a high-confidence way to reproduce the issue? Yes for the privacy finding: source shows the setting reaches the detail panel but is omitted from session rows, which render the newly added identifiers. The chart and count changes have focused model tests, but no native after-fix run is supplied. Is this the best way to solve the issue? Unclear. Session and daily count presentation follow existing dashboard patterns, but the session view must honor privacy and the hourly default needs an explicit history-access decision. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against d8c2af958176. LabelsLabel changes: No label changes. Label justifications:
EvidenceSecurity concerns:
What I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
|
Thanks @Yuxin-Qiao. Closing this as written: session titles and project labels, including tooltips, remain visible with Hide personal info enabled. The hourly change also replaces full-range history with the latest positive-spend day while summary totals retain the full range. No code was adopted. A maintainer-owned split can preserve privacy and handle partial counts separately after deciding the hourly-chart scope. |
Summary
Three places in Usage & Spend rendered data that was technically correct but useless in practice.
1. Sessions tab rows were indistinguishable
Every row showed the source name (e.g.
Codex · #1) plus the dominant model, and hid the timestamp whenever a model was known. With one account, all rows looked identical apart from cost.CostUsageSessionBreakdowngains optionaltitle/projectPath(defaultnil; OpenCodex and other producers unchanged). Codex session breakdowns fill them from the cached rolloutcwd/ title, which were previously dropped.SessionRow.headline= title → project folder name → source name;contextLabelsadd project/source/model. Subtitle is nowproject · source · model · date time. Only the last path component is shown.2. Hourly chart squeezed the whole range into one plot
Without a selected day, the hourly chart plotted every hour of the requested range (~1,400 hairline bars for 60 days).
CurrencyGroup.hourlyDayexposes that day and the panel header shows it next to the title. Selecting a day still wins.3. Daily ledger showed
—for tokens/requests on every mixed dayDaily token and request totals used
completeIntSum, so any cost-only provider on a day (Cursor, OpenCode Go, …) blanked the whole row, even when Codex reported tens of millions of tokens.DailySummary.hasPartialTokens/hasPartialRequestsmark the value as a floor (≥) when some active providers don't report the metric. Single-provider behavior is unchanged.Tests
SpendDashboardSessionAndHourlyTests(new suite, keepsSpendDashboardModelTestsunder the file-length limit):session rows prefer title and project over the source name,hourly chart focuses the newest day with spend when no day is selected.SpendDashboardDailyLedgerTests:cost only providers keep known token and request counts as a floor.CostUsageFetcherTests: session fixture gains acwdand assertsprojectPathflows through the store/cache path.Regenerated
CodexParserHash.generated.swift(the session builder lives in the hashed Codex parser directory) and refreshed theProviderArchitectureGatekeeperTestsline anchor forSpendDashboardModel.swift.Commands run
swift build --product CodexBarCLI(passes)make checkcould not run locally: this machine only has Command Line Tools (no Xcode, soactool, SwiftUI macro plugins, and sourcekitd are unavailable). CI (build, both macOS test shards, lint) is green.