feat(ui): show provider costs in context popover#100379
Conversation
|
Codex review: needs maintainer review before merge. Reviewed July 5, 2026, 1:42 PM ET / 17:42 UTC. Summary PR surface: Source +161, Tests +84, Docs 0. Total +245 across 66 files. Reproducibility: not applicable. as a feature PR rather than a bug report. Source inspection confirms current main has the Gateway cost field but the Control UI popover does not render it yet. Review metrics: none identified. Stored data model Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Next step before merge
Security Review detailsBest possible solution: Land the focused UI and Gateway display path after normal maintainer approval and required checks, keeping the existing context popover as the owner for session cost visibility. Do we have a high-confidence way to reproduce the issue? Not applicable as a feature PR rather than a bug report. Source inspection confirms current main has the Gateway cost field but the Control UI popover does not render it yet. Is this the best way to solve the issue? Yes. The existing context popover is the right owner boundary for showing the already-exposed session cost, and the provider-cost breakdown is additive with focused UI, Gateway projection, docs, and test coverage. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 35272d01b5dd. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +161, Tests +84, Docs 0. Total +245 across 66 files. View PR surface stats
What 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
Review history (1 earlier review cycle)
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: df2b217b76
ℹ️ 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".
|
|
||
| ### Changes | ||
|
|
||
| - **Control UI context cost:** show the current run's estimated USD cost in the chat context popover when the Gateway exposes it. |
There was a problem hiding this comment.
Remove the manual changelog entry
The root AGENTS.md Docs / Changelog rule says CHANGELOG.md is release-only and should not be edited for normal PRs or direct fixes because release generation owns these entries. This feature already carries release-note context in the commit message, so keeping this manual Unreleased line creates release-generation churn or duplicate/stale notes when the release changelog is regenerated.
Useful? React with 👍 / 👎.
df2b217 to
5c1ba3f
Compare
5c1ba3f to
50b62df
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
Land-ready at
Known proof gaps: none. |
|
Merged via squash.
|
* feat(ui): show estimated run cost * feat(ui): show provider cost breakdown


What Problem This Solves
The chat context popover shows current context and latest-run token usage, but omits estimated run cost and the provider's available cost breakdown.
Related: #100264
Why This Change Was Made
This keeps the existing optional
estimatedCostUsdsession field as the latest-run total, preserves provider cost components through chat-history projection, and shows the latest completed provider response's input, output, cache-read, and cache-write costs when present. Provider and concreteresponseModelidentify that response; requested model and session metadata remain fallbacks. A newer unanswered user message suppresses stale provider costs. No Gateway protocol or config change.User Impact
Users can see estimated run cost beside token usage and, when available, understand the provider-reported cost composition. Sessions and providers without those values continue to omit the cost rows rather than inventing data.
Evidence
Before
After
Visual-proof details and exact capture provenance.
tbx_01kwskdnwc3af7w2dngkzkyd1q(jade-crayfish).ui/src/e2e/chat-flow.e2e.test.ts, 21 passed.pnpm ui:i18n:check: 20 locales clean, zero fallbacks.pnpm ui:build: passed.pnpm check:changed, docs MDX/link checks, focused tests, browser E2E, i18n, and UI build also passed before the current-main rebase.AI-assisted implementation and review.