Skip to content

Agent chat: a streaming reply follows Reduce Motion when it turns on mid-reply - #27775

Merged
teamleaderleo merged 7 commits into
feat-cmux-nextfrom
lane/hq5058-live-reduced-motion
Nov 1, 2026
Merged

teamleaderleo merged 7 commits into
feat-cmux-nextfrom
lane/hq5058-live-reduced-motion

Conversation

@teamleaderleo

@teamleaderleo teamleaderleo commented Oct 30, 2026 •

Copy link
Copy Markdown
Collaborator

Fixes an internal report: a streaming reply that mounted with Reduce Motion off kept pacing its reveal and fading its newest words after Reduce Motion turned on, until the row remounted. The stylesheet had already switched.

Cause

useStreamReveal read prefers-reduced-motion once, into a ref, when the row mounted. StreamReveal copied that value into a readonly field in its constructor. Nothing listened for change, so fixing only the ref would still have left advance() pacing.

Change

  • StreamReveal.setReduceMotion(on): the field is no longer readonly. Turning it on shows everything received.
  • useStreamReveal adds one matchMedia change listener per mounted row, and removes it on unmount. When Reduce Motion turns on, it cancels the row's pending reveal frame, shows the whole reply in that commit and clears the fading steps (.cv-fresh). Later text then shows whole as it arrives, the same as in a row that mounted with Reduce Motion on. Turning it off paces later text again.
  • Unchanged: row identity, the defaults and the mount-time behaviour. No new per-token work: the listener runs only when the system setting changes.

Test

RevealedMarkdown.test.tsx, "turning Reduce Motion on mid-reply shows the whole reply and stops the reveal". It mounts a row with Reduce Motion off and paces three frames of a long reply. Then it switches the stubbed matchMedia to reduce and checks:

  • the whole reply shows;
  • no .cv-fresh span is left;
  • no reveal frame is pending;
  • a later delta shows whole in one frame with no fade;
  • unmounting removes the listener.

Red/green with bun test src/agent-session/acpmux/conversation/RevealedMarkdown.test.tsx through cmux-ci test:

  • red at the test-only commit 3eab9f1: the new test fails when Reduce Motion turns on, with the reply cut off mid-text (run 40982179853); the other 9 pass.

  • green at the fix, merged with base, e5ea1e9: 10/10 pass, along with test/streaming-text-frames.test.ts (run 41253723297). That run's one red, chromium: a followed reply rises line by line without jumps (-32.5 against a -25.75 floor), is a flake that also happens on base code. On the same runner it passed 3/3 at this head and failed 1/3 with base's RevealedMarkdown.tsx and streamReveal.ts, with the same -32.5.

  • A first Astra review at 7f5680b blocked with a P2: text that rendered but whose frame was cancelled before the reveal read it left StreamReveal behind what showed, so turning Reduce Motion off again could shrink the reply. bd4b2b8 adds a red test for it ("Reduce Motion on then off before a frame keeps what shows when later text arrives": the shown length dropped from 1974 to 154, run 41260981611). f20e8fe fixes it: setReduceMotion(true, text) takes in the latest text before it flushes.

  • green at f20e8fe: 11/11 pass (run 41266926949).

Review: Astra (gpt-6-astra, high) gave VERDICT: SHIP f20e8fe574b404c95bc0e32a4a2edde0b21e046b, with no P1, P2 or P3 findings.

Reds at this head: nightly-guards / release-notary ("Test What's New highlights and release notes") and its Guard status. The same steps fail on base's latest guard run 41262022316 at a2a65690, and this PR changes only the three webview files above.

UI: no visual change with Reduce Motion off. With it on, the reply shows whole at once, as a row that mounted under Reduce Motion already does.

Agent session: agent session

🤖 Generated with Claude Code

teamleaderleo and others added 2 commits October 30, 2026 00:49
Red first: a row that mounted with Reduce Motion off keeps pacing its
reveal after the preference turns on.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?id=aid-d0113a9b59e8132f3f6d
useStreamReveal read prefers-reduced-motion once at mount and StreamReveal
latched it in a readonly field, so a reply kept pacing and fading after
Reduce Motion turned on. Each row now listens for the media query's change
(removed on unmount); turning it on cancels the pending reveal frame, shows
the whole reply and retires the fading steps, and later text shows as it
arrives.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?id=aid-d0113a9b59e8132f3f6d
@github-actions github-actions Bot added the risk:normal Risk tier (docs/ci/risk-tiers.md) label Oct 30, 2026
@blacksmith-sh

blacksmith-sh Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Found 8 test failures on Blacksmith runners:

Failures

Test View Logs
/tmp/tmpda9c01on/summary-fail.json (live):/summary-fail.json (live): View Logs
/tmp/tmpwmy7ck2d/summary-missing.json (live):/summary-missing.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
convention violations found (ERROR lines above)./
convention violations found (ERROR lines above).
View Logs
test_every_part_of_bun_run_check_runs_in_the_warn_branch (main.WebviewsWarnSplitCov
ersCheck.test_every_part_of_bun_run_check_runs_in_the_warn_branch)/
test_every_part_of_bun_run_check_runs_in_the_warn_branch (main.WebviewsWarnSplitCov
ersCheck.test_every_part_of_bun_run_check_runs_in_the_warn_branch)
View Logs

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

@teamleaderleo
teamleaderleo marked this pull request as ready for review November 1, 2026 00:12
@github-actions

github-actions Bot commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

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

Review f20e8fe: 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=pr27775 -f ref=lane/hq5058-live-reduced-motion -f platform=macos -f backend_mode=local

Gallery before/after for 64fa07b: 16 states rendered, 4 images differ, 2729 more touched states not rendered. Images are in the run's artifact, not on this public PR; the independent review of this head reads them on its own, so the PR needs no hand-made screenshots of these states.

gh run download 41272552337 -R manaflow-ai/cmux -n gallery-advisory-27775-64fa07bc09b5767331624e20a883b3c8152b09dd (then read gallery-review.json)

States
State Theme Status Diff Picked by
agent-pane.streaming-text/claude Apple System Colors Light unchanged 0% own RevealedMarkdown.tsx
agent-pane.streaming-text/claude Apple System Colors unchanged 0% own RevealedMarkdown.tsx
agent-pane.streaming-text/codex Apple System Colors Light changed 0% own RevealedMarkdown.tsx
agent-pane.streaming-text/codex Apple System Colors changed 0% own RevealedMarkdown.tsx
agent-pane.streaming-text/jump-during-stream Apple System Colors changed 0.224% own RevealedMarkdown.tsx
agent-pane.streaming-text/jump-during-stream Apple System Colors Light changed 0% own RevealedMarkdown.tsx
agent-pane.transcript/activity-tone-secondary Apple System Colors Light unchanged 0% own RevealedMarkdown.tsx
agent-pane.transcript/activity-tone-secondary Apple System Colors unchanged 0% own RevealedMarkdown.tsx
agent-pane.transcript/activity-tone-tertiary Apple System Colors Light unchanged 0% own RevealedMarkdown.tsx
agent-pane.transcript/activity-tone-tertiary Apple System Colors unchanged 0% own RevealedMarkdown.tsx
agent-pane.transcript/activity-tone-readable Apple System Colors Light unchanged 0% own RevealedMarkdown.tsx
agent-pane.transcript/activity-tone-readable Apple System Colors unchanged 0% own RevealedMarkdown.tsx
agent-pane.transcript/message-surfaces-bordered Apple System Colors Light unchanged 0% own RevealedMarkdown.tsx
agent-pane.transcript/message-surfaces-bordered Apple System Colors unchanged 0% own RevealedMarkdown.tsx
agent-pane.transcript/message-surfaces-soft Apple System Colors Light unchanged 0% own RevealedMarkdown.tsx
agent-pane.transcript/message-surfaces-soft Apple System Colors unchanged 0% own RevealedMarkdown.tsx
agent-pane.transcript/message-surfaces-borderless Apple System Colors Light unchanged 0% own RevealedMarkdown.tsx
agent-pane.transcript/message-surfaces-borderless Apple System Colors unchanged 0% own RevealedMarkdown.tsx
agent-pane.transcript/conversation Apple System Colors Light unchanged 0% own RevealedMarkdown.tsx
agent-pane.transcript/conversation Apple System Colors unchanged 0% own RevealedMarkdown.tsx
agent-pane.transcript/footer-actions-left Apple System Colors Light unchanged 0% own RevealedMarkdown.tsx
agent-pane.transcript/footer-actions-left Apple System Colors unchanged 0% own RevealedMarkdown.tsx
agent-pane.btw-aside/before Apple System Colors Light unchanged 0% imports RevealedMarkdown.tsx (1 hops)
agent-pane.btw-aside/before Apple System Colors unchanged 0% imports RevealedMarkdown.tsx (1 hops)
agent-pane.btw-aside/answered Apple System Colors Light unchanged 0% imports RevealedMarkdown.tsx (1 hops)
agent-pane.btw-aside/answered Apple System Colors unchanged 0% imports RevealedMarkdown.tsx (1 hops)
agent-pane.btw-aside/pending Apple System Colors Light unchanged 0% imports RevealedMarkdown.tsx (1 hops)
agent-pane.btw-aside/pending Apple System Colors unchanged 0% imports RevealedMarkdown.tsx (1 hops)
agent-pane.btw-aside/failed Apple System Colors Light unchanged 0% imports RevealedMarkdown.tsx (1 hops)
agent-pane.btw-aside/failed Apple System Colors unchanged 0% imports RevealedMarkdown.tsx (1 hops)
agent-pane.btw-aside/dismiss Apple System Colors Light unchanged 0% imports RevealedMarkdown.tsx (1 hops)
agent-pane.btw-aside/dismiss Apple System Colors unchanged 0% imports RevealedMarkdown.tsx (1 hops)

Pick other states with a Gallery: entry.id, entry.id/variant line in the PR body.

red: cmux-next checks (god files, concurrency, crash safety, l10n); base red: the same failure on the base 320d9a3; does not block

Shipped in:

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 3 files

View guided diff | Turn on auto-fix | Re-trigger cubic

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 issues found across 3 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="webviews/src/agent-session/acpmux/conversation/RevealedMarkdown.test.tsx">

<violation number="1" location="webviews/src/agent-session/acpmux/conversation/RevealedMarkdown.test.tsx:321">
P2: This regression test does not verify that turning Reduce Motion off resumes pacing or that the later delta eventually appears. Assert the first post-toggle frame is shorter than the new text, then assert a later frame reaches the complete reply.</violation>
</file>

<file name="webviews/src/agent-session/acpmux/streamReveal.ts">

<violation number="1" location="webviews/src/agent-session/acpmux/streamReveal.ts:70">
P2: Toggling Reduce Motion off before the pending frame runs can make the reveal re-process already-visible text. The handler exposes the latest target after `setReduceMotion(true)` flushes only the stale `received` length, but disabling motion never rebases the internal cursor. Synchronize `StreamReveal` with the target text when enabling reduced motion and reset its pacing state when disabling it.</violation>
</file>

Reply with feedback, questions, or to request a fix.

View guided diff | Turn on auto-fix | Re-trigger cubic

motion.set(true);
expect(container.querySelector(".cv-md")?.textContent).toBe(shown);
motion.set(false);
render(`${shown} The release went out.`, true);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: This regression test does not verify that turning Reduce Motion off resumes pacing or that the later delta eventually appears. Assert the first post-toggle frame is shorter than the new text, then assert a later frame reaches the complete reply.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At webviews/src/agent-session/acpmux/conversation/RevealedMarkdown.test.tsx, line 321:

<comment>This regression test does not verify that turning Reduce Motion off resumes pacing or that the later delta eventually appears. Assert the first post-toggle frame is shorter than the new text, then assert a later frame reaches the complete reply.</comment>

<file context>
@@ -226,6 +226,102 @@ test("the last word shows once text stops arriving, while the reply still stream
+  motion.set(true);
+  expect(container.querySelector(".cv-md")?.textContent).toBe(shown);
+  motion.set(false);
+  render(`${shown} The release went out.`, true);
+  for (let index = 0; index < 20; index++) expect(frame(32 + index * 16).length).toBeGreaterThanOrEqual(shown.length);
+});
</file context>

Text can render and have its frame cancelled before StreamReveal reads it;
turning Reduce Motion on showed it while the reveal kept its older length,
so turning it off again re-revealed from there and the reply shrank.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?id=aid-d0113a9b59e8132f3f6d
@teamleaderleo

teamleaderleo commented Nov 1, 2026 •

Copy link
Copy Markdown
Collaborator Author

Review (the owner lane's independent review, at its land request): SHIP at f20e8fe

Recorded by lane-gh-broker from this PR's owner lane, which asked to land this exact head after its independent review. next-autoland lands it once every red is the base's; a BLOCK at this head, a HOLD line or a hold label still stops it.

@cmux-bot
cmux-bot Bot temporarily deployed to ci-routing-agent November 1, 2026 04:18 Inactive
@cmux-bot
cmux-bot Bot temporarily deployed to ci-routing-agent November 1, 2026 04:23 Inactive
@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Ready to land at f20e8fe574b404c95bc0e32a4a2edde0b21e046b: Astra (gpt-6-astra, high) gave VERDICT: SHIP f20e8fe574b404c95bc0e32a4a2edde0b21e046b, and RevealedMarkdown.test.tsx passes 11/11 (run 41266926949).

next-autoland / verdict calls release-notary this PR's own red. It is a base red. The failing tests are the same 3 at this head (job 124718856027) and on base (run 41262022316), with the same errors:

  • DigestTests.test_the_repository_highlights_validate: {'priority-view-drag.md': [...]} != {}
  • NightlyTrustedRouting.test_only_the_nightly_pickers_read_the_next_build_runner: Lists differ
  • one more, also identical by name and error

The newest base guard run, 41264191296 at 22abf5bc75, still fails the same step. This PR changes only RevealedMarkdown.tsx, streamReveal.ts and their test, none of which release-notary reads. The autoland classifier is misreading this run; the PR itself has no blocker.

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Review (codex gpt-6.1-sol xhigh, next-review): SHIP at 64fa07b

SHIP at 64fa07b

Visual verdict: no images; Leo tries the build

No correctness findings. Syntax and direct StreamReveal toggle checks passed. Bun tests could not run because Bun and project dependencies are absent.

  1. [P2] [follow-up] webviews/src/agent-session/acpmux/conversation/RevealedMarkdown.tsx:165: No after screenshots were supplied; verify the mid-reply Reduce Motion transition visually.

Follow-ups:

  • [P2] [follow-up] Verify the transition in the build; visual evidence is missing.

@cmux-bot cmux-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cmux-bot approves 64fa07b: an independent review passed this exact head (next-review receipt by teamleaderleo). A push needs a new review; a later BLOCK at this head dismisses this approval.

@teamleaderleo
teamleaderleo merged commit 4515d3d into feat-cmux-next Nov 1, 2026
181 of 187 checks passed
@teamleaderleo
teamleaderleo deleted the lane/hq5058-live-reduced-motion branch November 1, 2026 09:45

This branch was previously deployed

1 inactive deployment
ci-routing-agent — 64fa07bc Deployed Nov 1, 2026 by cmux-bot[bot] via wait for same-key tree publisher #93600
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk:normal Risk tier (docs/ci/risk-tiers.md)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant