Skip to content

Flicker + scroll-position bounce when double-Esc aborts a multi-subagent run past one screen #653

@esengine

Description

@esengine

Flicker + scroll-position bounce when interrupting a long subagent run.

Repro shape

  1. Trigger a workflow that spawns multiple subagents/security-review, /review, an init skill running parallel scans, anything that pushes a lot of streaming output through run_subagent while parent stays alive.
  2. Let the output fill more than one viewport — so the chat is scrolled (pinned to bottom but maxScroll > 0, or the user scrolled up to inspect a finding).
  3. Hit Esc to interrupt. Hit Esc again quickly (double-tap).

Observed: the screen flashes — sometimes the visible region jumps up, sometimes it bounces between two near-identical frames. The reporter describes it as "闪烁" with "滚动位置也会闪" (scroll position also flickers).

What's probably happening

Hypotheses, in order of likelihood — none verified yet:

  1. Abort path tears down N subagent inflights in quick succession — each unmount fires a useReserveRows collapse + state.cards mutation; with N≥2 subagent cards collapsing at once, CardStream re-measures maxScroll several frames in a row, the pinned=true invariant snaps scrollRows each time, and the deltas oscillate visibly. Single-subagent runs hide this because there's only one frame.
  2. Double-Esc isn't separately handled (App.tsx:1250-1263 only sees one key.escape && busy) but abortedThisTurn.current guards against double-execute. Still, the second Esc may hit the next handler — composer Esc — and clear input or trigger another render.
  3. Even with fix(render): force per-frame clear in alt-screen to kill log-update drift #640 + fix(ui): reset chat scroll to bottom when a confirm modal mounts #643, the rapid stream of setMaxScroll calls during teardown can interleave with the alt-screen clearTerminal we now do per frame in a way that paints two distinct end-states before settling.

Asking for ideal repro

  • Screen recording would be ideal (the flicker is too fast for a still).
  • Or: reasonix --version, a description of which skill / how many subagents, terminal name + version.

Related

Filed proactively from a chat report; will pin down the exact repro before any rendering-layer changes.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingrenderingTerminal rendering / flicker / repaint issues

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions