gallery health: Session Info's /context chats compact at 400K; three fold-push shift rows follow #32850/#32939

Merged
TE
2d ago
+19-6

Part of fixing the gallery health base red on feat-cmux-next (run 41623839244 at f504928798): the Session Info (chat-inspector) states other than the subagent ones.

What was red, and why

agent-pane.chat-inspector#context-autocompact-window: play: waitFor did not hold within 5000 ms. The play waits for 171.4K / 400K. The capture read 171.4K / 200K. #32639 added the state, a 1M model whose /context names a 400K window. #32665, its review follow-up ("Context window: the smaller of /context's and acpmux's"), made compactingUsage take the smaller of /context's window and acpmux's autocompact cap. The state's summary carries this file's ownUsage, which is capped at 200K, so the smaller window became 200K. The code does what #32665 meant; the fixture contradicted the state's own story. The fix: both /context chats (breakdownProps, used by context-breakdown and its alternatives, and context-autocompact-window) now carry a 400K acpmux cap. That matches what their notes say ("171.4k / 400k"). context-breakdown also read / 200K, against its note, but had no check to catch it.

Layout shift past baseline: #tasks-finished 0.0078 vs 0, #workflow-finished 0.0158 vs 0.00733, #workflow-agent-failed 0.0146 vs 0.00674. The box tracker reports 0 for all three. The score comes from the browser's layout-shift entries, and their sources in the run's results.json are only rows below the opened fold, pushed straight down:

  • workflow-finished / workflow-agent-failed: li.acpmux-workflow-phase (the Judge phase after the opened Critique) and button.acpmux-session-info-fold (the "Show more 路 Usage 路 Connectors" row), each [0 +144]. The old rows (0.0067-0.0073) were the Judge phase alone. #32939 ("a short default view, Leo's four then one Show more for the rest") added the Show more row under the last section, which doubles the pushed area.
  • tasks-finished: section.acpmux-session-info-section (Sources) pushed below the viewport. #32850 ("the machine, Context, what it runs, then Sources by default", Leo: "1. Machines ... 2. context 3. Subagents/background tasks running 4. Sources") put Sources directly below Background tasks, inside the viewport. When the shift rows were seeded (#30256), nothing visible sat under the fold.

Rows the fold doesn't own don't move sideways or up. Only the rows after it move down, which the box tracker (shift.ts) exempts on purpose ("a box after the target in document order that moves straight down: the expansion pushes it"). The browser's entries don't exempt that, and in place an expanding disclosure always pushes what follows it. Both culprits are deliberate layout changes Leo asked for, so the old rows were wrong for the new layout. This PR raises these three rows to the measured scores (the worst of the run, identical across themes and retries) and changes no component. #grid-expanded (same fold, no row) shows the same 0.0078.

Risk

Gallery-only: one fixture (two /context chats get a 400K cap) and three shift-baseline rows. No shipped code changes.

Follow-up worth considering, not done here since it would move every state's score: the play runner could drop browser layout-shift sources that the box tracker already exempts (rows after the target moving straight down). Then the push from a disclosure would stop needing nonzero rows.

Agent session: agent session

馃 Generated with Claude Code


Autofix with [code]smith
Open in [code]smith 路 Need help on this PR? Tag @codesmith-bot with what you need.


Summary by cubic

Fixes the Session Info gallery states that were red on feat-cmux-next: the /context chats now compact at 400K, and three layout-shift baselines follow the new fold layout. Gallery-only, no shipped code changes.

  • context-autocompact-window and context-breakdown read 171.4K / 200K because the fixture's acpmux cap (200K) sat under the 400K window /context names, and since #32665 compactingUsage takes the smaller of the two. Both /context chats now carry a 400K cap, matching what their notes claim.
  • tasks-finished, workflow-finished, and workflow-agent-failed shift baselines were raised to the measured browser scores. The old rows predate #32850 (Sources now sits below Background tasks) and #32939 (the Show more row under the last section); opening the fold pushes those rows down, which the browser's layout-shift entries count even though the box tracker exempts them.