Grok token history hides observed model names
Bug
Grok's local token history shows the daily token total but omits model names in the chart detail. Other providers show model names there when they have modelBreakdowns.
Cause
GrokLocalSessionSummary.toCostUsageTokenSnapshot already publishes the observed names in each daily entry's modelsUsed, but leaves modelBreakdowns nil because signals.json has only aggregate token counts. CostHistoryChartMenuView currently builds its model rows only from modelBreakdowns, so the available names never reach the detail view.
Reproduction
A synthetic signals.json with primaryModelId: "grok-4.6", modelsUsed: ["grok-4.6"], and nonzero aggregate tokens produces a daily token entry with a model name but no displayed model row.
Expected
Show the observed Grok model names as name-only rows beneath the daily token total. Do not assign the aggregate token count or an estimated cost to individual models, since the source does not provide that split.
Observed on main 78ba5a1e65e6859da59a21b799df95ab91bc0b89 (0.68.0).
Codex review: this still needs some work. Reviewed September 27, 2026, 6:54 AM ET / 10:54 UTC.
Summary Current main still hides observed Grok model names in token-history details. The source supports a narrow display bug, distinct from the related report about token totals failing to reach Usage & Spend.
Reproducibility: yes. from current source: a daily Grok entry with modelsUsed and nil modelBreakdowns reaches a chart whose detail-row builder returns no rows. This review did not run the app or tests.
Next step The current-source defect has a focused chart and test boundary; an implementation worker should first establish a failing regression.
Review details
Best possible solution:
Derive name-only chart rows from modelsUsed when breakdowns are absent, and include those rows in viewport sizing and render fingerprints; keep all per-model amounts unknown.
Do we have a high-confidence way to reproduce the issue?
Yes, from current source: a daily Grok entry with modelsUsed and nil modelBreakdowns reaches a chart whose detail-row builder returns no rows. This review did not run the app or tests.
Is this the best way to solve the issue?
Yes. A display-only fallback preserves the source's distinction between observed model names and unknown per-model usage.
AGENTS.md: found and applied where relevant.
Codex review notes: model internal, reasoning medium; reviewed against 78ba5a1e65e6.
Label changes
Label changes:
- add
P2: A bounded display defect hides useful Grok detail while leaving daily token totals visible. - add
impact:ux-friction: Users can see token totals but cannot see model names already observed by the local scanner. - add
issue-rating: 🦞 diamond lobster: Current issue advisory state selects this label. - add
clawsweeper:source-repro: Current issue advisory state selects this label. - add
clawsweeper:queueable-fix: Current issue advisory state selects this label. - add
clawsweeper:fix-shape-clear: Current issue advisory state selects this label.
Label justifications:
P2: A bounded display defect hides useful Grok detail while leaving daily token totals visible.impact:ux-friction: Users can see token totals but cannot see model names already observed by the local scanner.
Evidence reviewed
Acceptance criteria:
- swift test --filter CostHistoryChartMenuViewTests
- make test
- make check
What I checked:
- Grok snapshot contains names without per-model amounts: Daily entries carry modelsUsed from the scanned bucket while modelBreakdowns remains nil. (
Sources/CodexBarCore/Providers/Grok/GrokLocalSessionScanner.swift:57, 78ba5a1e65e6) - Menu drops name-only entries: The detail-row builder returns no rows when modelBreakdowns is absent, and the viewport is sized solely from breakdown counts. (
Sources/CodexBar/CostHistoryChartMenuView.swift:969, 78ba5a1e65e6) - Menu refresh also omits name-only changes: The daily render fingerprint records modelBreakdowns but not modelsUsed; a names-only repair must update this path. (
Sources/CodexBar/CostHistoryChartMenuView.swift:1230, 78ba5a1e65e6) - Existing fixture matches the report: The Grok projection test creates a daily entry with grok-4.6 in modelsUsed and no modelBreakdowns; chart tests cover viewport sizing only for populated breakdowns. (
Tests/CodexBarTests/GrokTokenSnapshotProjectionTests.swift:143, 78ba5a1e65e6) - Source data contract: The Grok documentation identifies modelsUsed and aggregate token fields in signals.json and says local signals do not establish dollar spend. (
docs/grok.md:273, 78ba5a1e65e6) - Related report has a different failure point: https://github.com/steipete/CodexBar/issues/3716 reports that Grok token totals never enter the snapshot on an older CLI path; it also notes that the chart cannot show model rows when breakdowns are nil.
Likely related people:
- Peter Steinberger: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
- Alec Gutman, Chip: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
- Peter Urda: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
How this review workflow works
- 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-reviewcomments, 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-reviewor@clawsweeper re-runon an open PR or issue to request a fresh review only. - Maintainers can also comment
@clawsweeper reviewto 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 explainto ask for more context, or@clawsweeper stopto stop active automation.