Repository navigation
Conversation
Group report rows by index and skip hourly and quota buckets for session and project reports. Persist breakdowns in the report memo so an unchanged relaunch decodes no cache. Record the first cwd per session in each transcript, and keep a day and model the daily report cannot price unpriced in every group.
|
🦞👀 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 Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex review: needs real behavior proof before merge. What this changesThis PR adds Claude session and project cost breakdowns to CLI output, the Cost menu, and Usage & Spend. Example: Inspect session-alpha with 110 recorded tokens under /Users/test/projects/alpha.
Review scores
ProductKind: Feature · Worth it: Needs a maintainer decision · Fix scope: Partial Merge readiness⛔ Blocked before merge - 4 items remain Keep this PR open: it delivers a distinct Claude capability invited for reconsideration, but grouped output loses an established incomplete-usage warning and the feature still needs an owner decision. Priority: P2 Decision needed
Before merge
Findings
Provenance
Tests
Agent review detailsHow this fits togetherThe local cost scanner reads Claude transcripts, reconciles duplicate usage records, persists generated caches, and supplies estimated costs to the CLI and app views. flowchart LR
A[Claude transcripts] --> B[Parser and reconciliation]
B --> C[Generated cache]
C --> D[Daily and grouped reports]
D --> E[Cost fetcher]
E --> F[CLI output]
E --> G[Menu and Usage Spend]
Technical reviewBest possible solution: Use the existing scanner and presentation owners for Claude breakdowns while preserving incomplete and unpriced subtotal warnings in grouped output. Do we have a high-confidence way to reproduce the issue? Current-main provider filtering and tests establish that Claude grouped text output is unavailable; source inspection also establishes the introduced warning bypass without executing target code. Is this the best way to solve the issue? Partitioning existing reconciled rows into existing breakdown models is appropriate, but reusing the Codex renderers must preserve Claude’s incomplete-usage contract. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 7447bc77c249. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. LabelsLabel changes:
Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed November 8, 2026, 9:52 AM ET / 14:52 UTC. |
|
Real behavior proof, from the CLI built from this branch (head Setup:
1. Upgrade from 0.81.0CodexBar 0.81.0 ran first on the same home and built its Claude cache. Then the branch build ran: The totals match. 2. Sessions and projectsThe projects add up to the $0.24 total. Each session's time is its last reply. 3. AppendI appended 2 replies to session Only that session and its project changed. The new total, $0.29, equals the sum of the projects. The session view also prints the existing "Pi/OMP usage is omitted" warning, because the default run can merge Pi rows into Claude. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fa7e607aca
ℹ️ 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".
| if groupBy == .session, Self.costGroupingProviders.contains(provider) { | ||
| return Self.renderSessionCostText(header: header, snapshot: snapshot, provider: provider) |
There was a problem hiding this comment.
Preserve incomplete-usage warnings in Claude grouped reports
When Claude logs contain both completed usage and a proxy request lacking final usage, these new grouped paths return before the incompleteRequestCount warning logic. Neither grouped renderer checks that count, while a fully parsed transcript still has historyIsFullyScanned == true, so --group-by session and --group-by project show completed-only cost/token subtotals without any Incomplete marker; the default report correctly warns for the same snapshot. Carry the incomplete-usage notice into grouped output, or mark affected groups, so users can tell these amounts exclude known requests.
Useful? React with 👍 / 👎.
Merge current main without losing session and project ownership or shared exact-event buffers. Preserve incomplete-usage notices in grouped CLI output and cover attribution alongside slice sharing.
Merge current main without rewriting the contributor history. Share local cost grouping and preserve incomplete-usage notices, Pi omission rules, and exact quota-event storage. Co-authored-by: Ory Band <oryband@users.noreply.github.com>
Follow-up to #4930, for Claude only, as suggested there. The Pi version is #5025.
What it does
codexbar cost --provider claude --group-by sessionand--group-by projectnow work.cwd. A conversation shows its short session id, as Codex text output does.projects[]. Like Codex, it has no per-session rows.How it works
sessionId. Sessions and projects are built from those same rows, so they add up to the Claude total.cwd, even when one file holds several sessions.cwdmap. A full parse or a forced rescan rebuilds it.Cost
Benchmarks against
main, debug build, 3 interleaved rounds:main, 3.29 s on this branch (+15%).Tests
All fixtures are synthetic.
Commands run: