Agent chat tests: the turn's token count stays quieter than its words

Merged
TE
15d ago
+141-0

Leo-ask: ask-03712a76b0

Leo (2026-10-21), on nightly 03960f5's "Working for 35s 路 679.9K tokens": "the token font shouldnt be this same color and shit".

What main already does

#23779 (merged after that nightly) already draws "路 679.9K tokens" in the theme's tertiary text token (--cv-text-dim, which is --agent-soft, the host's textTertiary) with tabular numerals. The rule is .cv-worked__count:has(> .cv-worked__tokens) in conversation.css. The line's words, "Working for 35s" or "Thinking", keep the secondary token (--cv-text-muted). The rule covers both lines that show the count: the bottom live line (Thinking.tsx, the default Codex layout) and the line over the turn when that layout is off (WorkingFor.tsx). The finished "Worked for" row shows no tokens, so it needs nothing. Leo's app gets this with the next web OTA or nightly.

What this PR adds

No test covered that rule, so a later style pass could undo it without anything failing. This PR adds tests:

  • test/agent-pane-turn-tokens-muted.test.tsx: for both lines, the count is its own .cv-worked__count > .cv-worked__tokens span, after the words and outside them. The CSS rule for it uses var(--cv-text-dim) with tabular-nums and has no literal color. .cv-worked keeps var(--cv-text-muted).
  • test/agent-pane-turn-tokens-muted-browser.test.tsx (browser lane): loads the real stylesheets in Chromium with a host theme and checks the resolved colors. The words are the theme's secondary color, the count and its "路" are the tertiary, and the count uses tabular numerals.

No product code changes.

Before / after

Gallery agent-pane.transcript / working-tokens (synthetic fixture, Reduce Motion so the line holds still). Before is nightly 03960f5's gallery; after is feat-cmux-next's (this branch draws the same). Resolved colors, dark: words rgb(170,170,170), tokens before rgb(170,170,170), after rgb(136,136,136). Light: words rgb(97,97,97), tokens before rgb(97,97,97), after rgb(127,128,128).

Before (03960f5)After (feat-cmux-next)
Darktokens before darktokens after dark
Lighttokens before lighttokens after light

The after shots show the Codex layout's bottom line ("Thinking 5m 56s 路 2.1M tokens"). The time is also in the tertiary color there, which was already the case before this ask. With that layout off, the line over the turn keeps "Working for 35s" in the secondary color and draws the count in the tertiary color (checked by the browser test).

Changelog

none

Observed / Not run

  • Ran: bun scripts/check-browser-test-lanes.ts (passes), vp fmt on the new files, and the gallery screenshots above, with their computed colors read in headless Chromium.
  • Not run locally: bun test is blocked on this Mac (cosmic-gray, no local test runs). The PR's webviews CI runs both files, and the browser file runs in the browser lane.

Agent session: cosmic-gray

馃 Generated with Claude Code