feat(chat): UX-012 β token usage progress meter#89826
Conversation
|
Codex review: found issues before merge. Reviewed June 25, 2026, 12:21 PM ET / 16:21 UTC. Summary PR surface: Source +58, Tests +44. Total +102 across 3 files. Reproducibility: yes. Source inspection gives a high-confidence path: render an active session with totalTokens, contextTokens, and totalTokensFresh=false; this PR passes only raw totalTokens into the meter while current sibling context UI hides that stale state. Review metrics: none identified. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Proof path suggestion Risk before merge
Maintainer options:
Next step before merge
Security Review findings
Review detailsBest possible solution: Refresh the branch and drive the meter from the same freshness-aware context usage model as the existing notice, with explicit stale-token behavior and tests. Do we have a high-confidence way to reproduce the issue? Yes. Source inspection gives a high-confidence path: render an active session with totalTokens, contextTokens, and totalTokensFresh=false; this PR passes only raw totalTokens into the meter while current sibling context UI hides that stale state. Is this the best way to solve the issue? No. The visible meter is plausible, but the maintainable fix is to reuse or match the existing freshness-aware context model instead of adding a parallel raw-token calculation. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 19707cce1d73. Label changesLabel justifications:
Evidence reviewedPR surface: Source +58, Tests +44. Total +102 across 3 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
|
There was a problem hiding this comment.
Pull request overview
This PR adds a small token/context usage progress meter to the chat composer UI, based on session token totals versus the thread context window. In addition, it introduces new UI signals for tool-call failures (banner + sidebar dot) and expands the agent overview page with extra cards.
Changes:
- Add a 2px token usage meter in the chat composer with tiered coloring and reduced-motion handling.
- Track/display tool-call failures via a warning banner in chat and a pulsing indicator dot in the sidebar recent-sessions list.
- Add βMemory Tiersβ and βRole Contractsβ cards to the agent panels overview and tweak chat sidebar styling (backdrop blur).
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| ui/src/ui/views/chat.ts | Adds token meter rendering and introduces session-level tool error detection/tracking + banner. |
| ui/src/ui/views/agents-panels-overview.ts | Adds two additional overview cards (with loading skeleton states). |
| ui/src/ui/app-render.ts | Adds sidebar recent-session tool-error indicator using sessionHasKnownToolErrors. |
| ui/src/styles/layout.css | Styles/animates the new sidebar tool-error dot. |
| ui/src/styles/chat/sidebar.css | Adjusts chat workspace rail background and adds backdrop blur filters. |
| ui/src/styles/chat/layout.css | Adds CSS for the token usage meter and reduced-motion behavior. |
|
@clawsweeper review |
|
π¦π§Ή I asked ClawSweeper to review this item again. Re-review progress:
|
2f700dd to
3b9121a
Compare
|
@clawsweeper review |
|
π¦π§Ή I asked ClawSweeper to review this item again. Re-review progress:
|
Adds a 2px progress bar at the base of the chat composer showing context usage.
Token data source:
activeSession.totalTokens/threadContextWindow(already computed in renderChat).Part of UI/UX Enhancement Sprint 2.