Skip to content

fix(tui): open /context (not /cost) when clicking the ⚠ capped marker - #3826

Merged
dgageot merged 1 commit into
mainfrom
fix-capped-context-segment
Jul 24, 2026
Merged

fix(tui): open /context (not /cost) when clicking the ⚠ capped marker#3826
dgageot merged 1 commit into
mainfrom
fix-capped-context-segment

Conversation

@aheritier

Copy link
Copy Markdown
Collaborator

What & why

Follow-up to #3813. On the sidebar Token Usage reading, clicking the ⚠ capped marker opened the /cost dialog. The cap is a compaction-model context-window limit, not a cost matter, so it should open the /context dialog instead.

How

In tokenUsageLine(), the context-segment width (usageContextSegWidth) was captured before the ⚠ capped marker was appended, leaving the marker in the cost segment. Moving the capture to after the append brings ⚠ capped into the context segment. The cost segment now starts at the $… figure. The click-offset boundary is otherwise unchanged, so both the vertical reading and the collapsed band are fixed through the shared width.

Behavior

  • ⚠ capped/context
  • token count · (NN%) · (compacting…)/context
  • $… · sub-session count → /cost

Tests

Added capped-marker cases (vertical + collapsed band) asserting → context and $ → cost.

Docs

docs/features/tui/index.md and the Unreleased CHANGELOG entry updated to list ⚠ capped under the context part (amends the still-unreleased #3813 wording).

Plan: agent-card-context-cost-clicks

@aheritier
aheritier requested a review from a team as a code owner July 24, 2026 10:35
@aheritier aheritier added area/docs Documentation changes area/tui For features/issues/fixes related to the TUI kind/fix PR fixes a bug (maps to fix:). Use on PRs only. labels Jul 24, 2026
@dgageot
dgageot merged commit c29acb0 into main Jul 24, 2026
27 of 28 checks passed
@dgageot
dgageot deleted the fix-capped-context-segment branch July 24, 2026 12:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/docs Documentation changes area/tui For features/issues/fixes related to the TUI kind/fix PR fixes a bug (maps to fix:). Use on PRs only.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants