Agent pane flickers when a thought opens like an earlier one: the old Thought takes its reveal #569

Closed
opened 2026-11-20 14:52:55 -05:00 by cmoriarty · 1 comment
Owner

What happens
On run 204's agent.code-review, with show thinking on, the agent pane switches layouts every 40–120 ms: the live Thinking row loses its text and gets it back, and the scroll jumps each time. #552's fix is live; this is a second cause.

Why
A settled row takes over a live row's reveal by matching text, not part (adoptReveal). The agent was looping, and every thought opened "I keep running commands. Let me stop…", so each earlier Thought the list mounted took the new thought's reveal and then deleted it. The live row restarted from nothing, heights swung, the follow jumped, and more old rows mounted.

Fix
Hand a reveal only to the settled row of its own part. A settled row never takes or deletes a live row's reveal.

Done when
A test streams a thought that opens like an earlier settled Thought, and on every frame the earlier Thought keeps its height and the live row keeps its text.

Where to look: ui/src/lib/reveal.ts (adoptReveal), Reasoning.tsx, settled prose in Transcript.tsx.

Seen by the owner on run 204 (a screen recording); diagnosed 2026-11-20.

**What happens** On run 204's `agent.code-review`, with show thinking on, the agent pane switches layouts every 40–120 ms: the live Thinking row loses its text and gets it back, and the scroll jumps each time. #552's fix is live; this is a second cause. **Why** A settled row takes over a live row's reveal by matching text, not part (`adoptReveal`). The agent was looping, and every thought opened "I keep running commands. Let me stop…", so each earlier Thought the list mounted took the new thought's reveal and then deleted it. The live row restarted from nothing, heights swung, the follow jumped, and more old rows mounted. **Fix** Hand a reveal only to the settled row of its own part. A settled row never takes or deletes a live row's reveal. **Done when** A test streams a thought that opens like an earlier settled Thought, and on every frame the earlier Thought keeps its height and the live row keeps its text. Where to look: `ui/src/lib/reveal.ts` (`adoptReveal`), `Reasoning.tsx`, settled prose in `Transcript.tsx`. *Seen by the owner on run 204 (a screen recording); diagnosed 2026-11-20.*
Author
Owner

Shipped in #571 (change reveal-handover-by-part, archived in #572). Live as 59c8aad since 20:26 UTC on 2026-11-20.

A settled row now carries on only the reveal of its own parts. Lines carry their part ids, and one function names a reveal for both the live row and the hand-over. So an earlier Thought that reads like the thought being written no longer takes its reveal, and the agent pane no longer swings between layouts while a looping agent thinks.

Evidence

  • The new journey ui/e2e/live-thought.spec.ts streams a thought that opens like an earlier one, through the test server's new /_test/delta route. On main it failed three ways:

    • the earlier thought's first frame showed only the new thought's text;
    • its height changed 4 times in 120 frames;
    • back at the tail, the new thought's text was empty on its first frame.

    With the fix it passes, 6 times in 6 repeated runs.

  • A vitest test of the hand-over failed first on the text matching, then passed.

  • A probe in a 2200 px window with scrollbars drawn streamed the looping thought and wheeled the pane up and down for ten seconds. The earlier thought changed height 6 times in each run on main's UI, and 0 times with the fix.

An open console picks up the fix once the page is reloaded.

**Shipped** in #571 (change `reveal-handover-by-part`, archived in #572). Live as 59c8aad since 20:26 UTC on 2026-11-20. A settled row now carries on only the reveal of its own parts. Lines carry their part ids, and one function names a reveal for both the live row and the hand-over. So an earlier Thought that reads like the thought being written no longer takes its reveal, and the agent pane no longer swings between layouts while a looping agent thinks. **Evidence** - The new journey `ui/e2e/live-thought.spec.ts` streams a thought that opens like an earlier one, through the test server's new `/_test/delta` route. On main it failed three ways: - the earlier thought's first frame showed only the new thought's text; - its height changed 4 times in 120 frames; - back at the tail, the new thought's text was empty on its first frame. With the fix it passes, 6 times in 6 repeated runs. - A vitest test of the hand-over failed first on the text matching, then passed. - A probe in a 2200 px window with scrollbars drawn streamed the looping thought and wheeled the pane up and down for ten seconds. The earlier thought changed height 6 times in each run on main's UI, and 0 times with the fix. An open console picks up the fix once the page is reloaded.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
cmoriarty/braid#569
No description provided.