Repository navigation
fix(spend): name and rank session rows - #4020
Conversation
Show the Codex thread name, project, and date on each Usage & Spend session row instead of the provider name. Rank sessions by cost like Projects, keep up to 50, and collapse after 8 with Show all. Hide personal information masks the name to the short session ID and drops the project.
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs real behavior proof before merge. Reviewed September 26, 2026, 1:04 PM ET / 17:04 UTC (Revision 2). ClawSweeper reviewWhat this changesThe branch gives Usage & Spend session rows thread and project names, dates, cost ranking, privacy masking, an expandable 50-row limit, and supporting tests and documentation. Merge readiness⛔ Blocked before merge - 2 items remain Current main still shows generic session rows, so this PR remains useful. The latest commit addresses the prior relative SQLite home finding with a focused test. The remaining merge blocker is proof from a freshly built app using real local Codex sessions. Priority: P2 Review scores
Verification
How this fits togetherCodexBar scans local Codex session files and cost history to build the Usage & Spend dashboard. The settings view turns those session records into ranked rows while applying the privacy setting. flowchart LR
A[Local Codex sessions] --> B[Cost scan]
C[Thread index and database] --> D[Session metadata lookup]
B --> E[Dashboard rows]
D --> E
F[Privacy setting] --> E
E --> G[Ranked session list]
Before merge
Agent review detailsSecurityNone. Review metrics
Technical reviewBest possible solution: Land the bounded dashboard change once a freshly built CodexBar app demonstrates named, ranked, and privacy-masked rows from real local Codex sessions. Do we have a high-confidence way to reproduce the issue? Yes, from source: current main renders the provider name for each session and caps the newest-first list at 12. The review did not run the app. Is this the best way to solve the issue? Yes. The branch reuses the existing Codex thread metadata reader and dashboard row model, and the latest test covers the previously identified relative SQLite path case. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 5890d052a3be. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat 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)
|
Resolve relative SQLite homes from the original rollout directory and format session subtitles with the dashboard calendar. Cover privacy masking, deterministic ranking, unchanged totals, and synthetic renders; simplify title and rank copies. Follow up on steipete#4020 while preserving the contributor commit.
|
Merged as yours, @urda, with your commit intact; the maintainer commit on your branch fixed two things the review found (a relative |
Summary
The Usage & Spend Sessions tab showed the same "Codex / " pair on every row. You could not tell sessions apart or see when they happened. Since #3353 moved this list into Settings, the row title holds the provider name and the subtitle holds the model, so the date shows only when the model is missing. The list also stopped at the 12 most recent sessions.
The data to fix this already exists:
session_index.jsonl(andstate_*.sqlite), andCodexThreadMetadataReaderalready reads them for agent sessions.Changes
CostUsageSessionBreakdowngets three optional fields:projectPath,projectName,title. They default tonil, so existing call sites do not change.CodexThreadMetadataReader. It skips the lookup when the sessions root is not inside a Codex home.Session <short id>, like the menu Conversations list.Notes for review
CostUsageScanner+Projects.swiftregeneratesCodexParserHash, so the Codex cost cache rescans once after upgrade.CostUsageFetcher.swift,SpendDashboardController.swift,SpendDashboardModel.swift).shortSessionIDis nownonisolatedso that the nonisolated row identity can use it.Screenshot
Synthetic fixture render from
SpendDashboardScreenshotRenderTests(CODEXBAR_SPEND_PROOF_DIR):Validation
make check: 0 violations.make test: 129 of 129 groups passed on the first pass. (Local run with--build-system nativebecause of an Xcode 27actoolissue on my machine.)SpendDashboardSessionRowTests: cost ranking, unpriced last, 50-row cap, name and project carry-through, privacy masking, short-ID fallback.CostUsageFetcherTests: a fixturesession_index.jsonlname and a rolloutcwdreach the snapshot, and the lookup skips roots outside a Codex home.Follow-ups (not in this PR)
title.