Add Codex project cost rollups - #1884
Conversation
|
Codex review: needs maintainer review before merge. Reviewed July 4, 2026, 5:47 AM ET / 09:47 UTC. Summary Reproducibility: not applicable. as a bug reproduction; this is a feature PR. Source inspection confirms current main lacks project rollup types or Review metrics: 3 noteworthy metrics.
Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Mantis proof suggestion Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Merge after normal maintainer review if the project/path reporting contract and one-time cache metadata migration are intentional. Do we have a high-confidence way to reproduce the issue? Not applicable as a bug reproduction; this is a feature PR. Source inspection confirms current main lacks project rollup types or Is this the best way to solve the issue? Yes, with maintainer acceptance of the compatibility risk. The additive scanner/model layer plus CLI/menu exposure is maintainable, and this replacement fixes the earlier source-row, refresh-signature, and cache-artifact concerns. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against f6732bd76078. Label changesLabel changes:
Label justifications:
Evidence reviewedWhat I checked:
Likely related people:
What the crustacean ranks mean
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. How this review workflow works
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0560160834
ℹ️ 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".
| var exitCode: ExitCode = .success | ||
|
|
||
| for provider in providers { | ||
| for provider in providers where groupBy != .project || provider == .codex || format == .json { |
There was a problem hiding this comment.
Fail when project grouping leaves no provider
When text output is grouped by project and the selected providers do not include Codex (for example, codexbar cost --provider claude --group-by project), this filter skips every provider after only emitting a warning, leaving sections empty and exiting with success and no stdout. That makes an unsupported invocation look successful; fail before the loop or fall back to regular cost output when the filtered provider set is empty.
Useful? React with 👍 / 👎.
Group local Codex usage and costs by canonical project and worktree source across menus, CLI text, and JSON output. Preserve the existing cache artifact while migrating project metadata safely, and avoid rendering legacy cache rows before migration. Co-authored-by: Clemens Peters <c.peters@conventic.com>
0560160 to
46a3001
Compare
Summary
Maintainer replacement for #1820 because the contributor fork cannot accept the current-main repair through the available OAuth workflow scope. Based on @clemenspeters's implementation; contributor authorship and changelog credit are preserved.
Closes #1819.
Validation
46a30014728552ed5ddeef43dbc9e85bb1474da4make check— repository guards, parser hash, SwiftFormat, and strict SwiftLint passed on the current-main candidatemake test— all 46 sharded groups passed on the reviewed project-rollup tree; exact-head CI reruns the full matrix against latest mainswift test --filter 'CostUsage|CostHistory|CLICost|StatusMenuHostedSubmenuRefresh'— 252 tests in 24 suites passed on the current-main candidateCODEXBAR_DISABLE_KEYCHAIN_ACCESS=1 ./Scripts/compile_and_run.sh— exact signed production app packaged, launched, and remained runningLive UI boundary
The host reports Screen Recording and Accessibility denied, so menu screenshot/click proof is unavailable. The exact production app and bundled CLI exercised the real scanner, cache, canonicalization, and rendering payload path without accessing Keychain credentials.
Risk
Medium and local-data scoped. The migration intentionally narrows the retained cache window once so unscanned legacy rows cannot be mislabeled; wider history is repopulated from the original local session files on demand. Raw local paths remain confined to the existing opt-in local cost UI and CLI output.