Skip to content

Agent chat: a streamed turn never flickers Session Info or the header (guard test) - #33526

Merged
teamleaderleo merged 1 commit into
feat-cmux-nextfrom
lane/si-no-flicker
Nov 3, 2026
Merged

teamleaderleo merged 1 commit into
feat-cmux-nextfrom
lane/si-no-flicker

Conversation

@teamleaderleo

@teamleaderleo teamleaderleo commented Nov 3, 2026 •

Copy link
Copy Markdown
Collaborator

Leo, 2026-11-03: "likewise i don't want to see flickers of the session info or anything when there's random re-renders EVER"

Closes #33201. Builds on #33203, which stopped Session Info from re-rendering on every streamed update. This PR adds the painted-frame guard the issue asked for: it covers the chat header too, runs in WebKit as well as Chromium, and drives the real pane instead of a harness.

What flickered

Nothing, at base or at the commit just before #33203 (a86fae3). Every Session Info box (the panel, the Environment and Context sections and their bodies) and every chat header box (the header, its status slot, its tools) kept the same element, the same box, the same opacity and visibility, and its text, on every painted frame of the stream. No animationstart, transitionstart or transitionrun fired inside either one, and no element was removed from either one. The re-renders #33203 removed never reached the screen as a visible flicker. So this PR changes no product code and lands the test as a guard.

Test

webviews/test/agent-pane-streaming-no-flicker.test.ts (browser lane, Chromium and WebKit). The test serves the pane's dev entry and connects it to a stand-in acpmux. It turns Session Info on, then streams a long turn: 12 steps, each sending reply tokens one word at a time, a tool call that starts and finishes, and a usage tick with session_changed. After every painted frame (support/paintedFrames.ts) it reads each box of Session Info and of the header. It fails on any of these:

  • a remount (a new element, or an element removed per the MutationObserver)
  • a box that moves or resizes by more than 0.5 px
  • an opacity or visibility change
  • a box that had text and paints empty
  • an animation or transition that starts

A control at the end of the test replaces a section with a copy, dims the header for one frame and starts a CSS animation on a header tool. It asserts that the sampler reports all three, so a green run means nothing flickered, not that the sampler saw nothing.

Command: cmux-ci test --setup playwright -- bash -c 'export "$(bash scripts/ci/ensure-system-chrome.sh --optional | tail -1)"; cd webviews && CMUX_BROWSER_TESTS=1 bun test test/agent-pane-streaming-no-flicker.test.ts'

run chromium frames webkit frames remounts / moves / blinks / empties / animations
base db4c64e 385 311 0 / 0 / 0 / 0 / 0
before #33203 (a86fae3) 373 287 0 / 0 / 0 / 0 / 0
head (with control) 475 392 0 / 0 / 0 / 0 / 0; control caught 2 remounts, 2 blinks, 1 animationstart in each engine

There is no red-on-base run because no flicker reproduces; the control is what shows the test can fail.

Observed / Not run

  • Observed: the runs in the table above, on the fleet, both engines green, with the frame counts and the control's catches as listed. scripts/web-lint.sh (with CMUX_LOCAL_HEAVY_CHECKS=0) and prepush-gate.py are clean.
  • Not run: the type-aware lint and type check, which are left to CI on this host. Sections that need a daemon with a git worktree, subagents or tasks (Changes, Tasks, Agents) do not appear in the stand-in, so the test does not cover them.

Changelog

none

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

Adds a guard test that a streamed agent turn never flickers Session Info or the chat header, in Chromium and WebKit.

  • Drives the real pane's dev entry with a stand-in acpmux over a long streamed turn, sampling every painted frame for remounts, layout shifts, opacity/visibility blinks, empty text, and starting animations or transitions.
  • A control at the end confirms the sampler catches each kind of flicker, so a green run means nothing flickered.
  • No product code changes; no flicker reproduces at base, so this lands as regression protection for the issue's "no flicker ever" requirement.

Written for commit 3506a43. Summary will update on new commits.

View guided diff Turn on auto-fix

…ader

The real pane, with Session Info open, takes a long streamed turn (reply
tokens, tool calls that start and finish, usage ticks) and reads every box of
Session Info and of the chat header on every painted frame, in Chromium and
WebKit: none is replaced, moves, changes opacity or visibility, or paints empty,
and no CSS animation or transition starts in either. A control at the end
shows the sampler catches a remount, a blink and an animation start.

No flicker reproduces at base or at the commit before #33203; the test lands as
a guard (cmux#33201). Fleet runs: green in both engines at base (385/311
frames) and at a86fae3 (373/287 frames).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?id=aid-81baa1463f6190d4c5dc
@teamleaderleo teamleaderleo added risk:normal Risk tier (docs/ci/risk-tiers.md) leo-named-fix An obvious fix to something Leo named: lands on push, review runs in parallel labels Nov 3, 2026
@teamleaderleo
teamleaderleo merged commit 1ecea5a into feat-cmux-next Nov 3, 2026
143 of 188 checks passed
@teamleaderleo
teamleaderleo deleted the lane/si-no-flicker branch November 3, 2026 09:35
@github-actions

github-actions Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

cmux status (one comment, edited in place; each line is updated by the job that owns it)

Review 3506a43: HQ feed card · gallery before/after runs · checks

App of this head (app.zip, kept 1 day)

gh workflow run reload-build.yml -R manaflow-ai/cmux --ref feat-cmux-next -f tag=pr33526 -f ref=lane/si-no-flicker -f platform=macos -f backend_mode=local

Unclear: web / react-apps-check failed: no known signature; failed step: Check webview test shards. This PR merged before its CI finished: fix forward on main.

CI failed on 3506a43f5e (run 41612168964 attempt 1): 1 code, 1 unknown.

Job Verdict Why
web / react-apps-check (1) code a web test failed
web / react-apps-check unknown no known signature; failed step: Check webview test shards

Failures:

  • seen on other PRs message-preview-browser.test.ts sent preview has no fade or partial chip and Show more reveals all of it: failed (job)
Matched log lines
web / react-apps-check (1): (fail) sent preview has no fade or partial chip and Show more reveals all of it [6335.90ms]

Not re-run automatically: web / react-apps-check (1), web / react-apps-check are not machine failures.

Written by scripts/ci/classify_failures.py (ci-failure-attribution.yml); signatures are its SIGNATURES table. A machine verdict is the runner's fault, not this PR's; yours means the failing file is one this PR changes, also red on main that main's latest full suite fails the same way, seen on other PRs that it failed on another pull request's run lately.

Shipped in:

@blacksmith-sh

blacksmith-sh Bot commented Nov 3, 2026

Copy link
Copy Markdown

Found 6 test failures on Blacksmith runners:

Failures

Test View Logs
/tmp/tmp39hc0tdv/summary-missing.json (live):/summary-missing.json (live): View Logs
/tmp/tmpviba5geh/summary-fail.json (live):/summary-fail.json (live): View Logs
[new_workspaces] debug.new_workspace timed 0 of 50 new workspace rows/
[new_workspaces] debug.new_workspace timed 0 of 50 new workspace rows
View Logs
[new_workspaces] the window draws no frames/[new_workspaces] the window draws no frames View Logs
[tabs] debug.tab_switch timed 0 of 40 switches/
[tabs] debug.tab_switch timed 0 of 40 switches
View Logs
[tabs] the window draws no frames/[tabs] the window draws no frames View Logs

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

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Review (subagent claude-opus-5-5 medium): SHIP at 3506a43

Visual verdict: unchanged by this diff

Checked the test against agent-pane-turn-end-keeps-place.test.ts and support/paintedFrames.ts. Every read goes through cmuxAfterPaint or cmuxPaintFrame, and there is no requestAnimationFrame read, so check-frame-reads has nothing to flag. The stand-in daemon matches the sibling's protocol (initialize, watch, attach, events, _acpmux/event, session_changed), and requireBrowserLane plus the l10n-allow-file and cmux-web-test-timeout headers are in place. It cannot pass vacuously: it asserts the panel, header and a [data-section] key exist, asserts more than 100 frames, and a control shows the sampler catches a remount, a removal, a blink and an animation. The control's one-frame blink is safe, since the sampler's frame callback is registered before cmuxPaintFrame's and its read task is queued first.

Follow-ups: (1) only keys present on the first sampled frame are checked, so a section or header tool that mounts mid-stream is never itself checked (its effect on its neighbours' boxes still is); (2) moves and blinks stop at the first hit per key, so a report can hide a later, different flicker of the same box. Neither blocks.

@github-actions github-actions Bot added risk:low Risk tier (docs/ci/risk-tiers.md) and removed risk:normal Risk tier (docs/ci/risk-tiers.md) labels Nov 3, 2026
lawrencecchen added a commit that referenced this pull request Nov 3, 2026
…; from #33526) (#33545)

* base red: the no-flicker test drops its unused outer Box type (each page.evaluate body declares its own; from #33526)

* base red: the no-flicker test's page listener types its parameter as globalThis.Event (the file's own Event type shadowed it; from #33526)
teamleaderleo pushed a commit that referenced this pull request Nov 3, 2026
…; from #33526) (#33545)

* base red: the no-flicker test drops its unused outer Box type (each page.evaluate body declares its own; from #33526)

* base red: the no-flicker test's page listener types its parameter as globalThis.Event (the file's own Event type shadowed it; from #33526)
Co-authored-by: Codex <199175422+chatgpt-codex-connector[bot]@users.noreply.github.com>

Agent-Session: https://cmux.com/deeplink/agent?id=aid-d60a77e16a11b66e2ecf
teamleaderleo added a commit that referenced this pull request Nov 3, 2026
* perf: batch transcript row measurements after content layout

Co-authored-by: Codex <199175422+chatgpt-codex-connector[bot]@users.noreply.github.com>
Agent-Session: https://cmux.com/deeplink/agent?id=aid-fc0fa4c5ed2467ab49a6

* base red: the no-flicker test type-checks (unused Box, shadowed Event; from #33526) (#33545)

* base red: the no-flicker test drops its unused outer Box type (each page.evaluate body declares its own; from #33526)

* base red: the no-flicker test's page listener types its parameter as globalThis.Event (the file's own Event type shadowed it; from #33526)
Co-authored-by: Codex <199175422+chatgpt-codex-connector[bot]@users.noreply.github.com>

Agent-Session: https://cmux.com/deeplink/agent?id=aid-d60a77e16a11b66e2ecf

---------

Co-authored-by: Codex <199175422+chatgpt-codex-connector[bot]@users.noreply.github.com>
Co-authored-by: Lawrence Chen <54008264+lawrencecchen@users.noreply.github.com>

This branch was successfully deployed

No deployments
ci-routing-agent — 3506a43f Deployed Nov 3, 2026 by teamleaderleo via cmux-tui tree preflight #105232
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

leo-named-fix An obvious fix to something Leo named: lands on push, review runs in parallel risk:low Risk tier (docs/ci/risk-tiers.md)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant