CodexBar icon indicating copy to clipboard operation
CodexBar copied to clipboard

Grok token history hides observed model names

Open BUKOWSKIREAL opened this issue 2 months ago • 1 comments

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).

BUKOWSKIREAL avatar Sep 27 '26 10:09 BUKOWSKIREAL

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:

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-review comments, 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-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to 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 explain to ask for more context, or @clawsweeper stop to stop active automation.

clawsweeper[bot] avatar Sep 27 '26 10:09 clawsweeper[bot]