Skip to content

Streaming tokens can move the transcript after a pending reply #4863

Closed

Description

@leaf-agent

The first token update after sending an interjection can move all messages down 11px while the card's top stays fixed. This reproduces on current main, independently of #4843; the root cause is unresolved (product scroll restoration versus test synchronization).

On main 2c080bbbcd7ba52f89f0c87e6b50077fe7a9e954, this selection produced four passes and one failure in 20.32s on the Linux Tend runner:

uv run pytest -q -n0 tests/browser/margin/test_card_reply.py -k 'a_margin_reply_send_shows_the_sent_turn or a_growing_margin_reply_keeps_the_previous_turn_visible or sending_during_a_stream'

test_sending_during_a_stream_keeps_later_tokens_from_moving_the_reading[pending] failed at append_tokens(8): message tops changed from [10, 111, 191] to [21, 122, 202]; the preceding card-top assertion passed. The same selection on PR head 16c87eb5f7a57f625b6efbb273ce075dac4d9940 produced the identical pending failure. Reverting only that head's rises condition to require writing also produced the identical movement, in both accepted and pending cases. No runtime suite ran alongside these selections.

The maintainer's macOS repetitions passed both with and without the new rises condition, as recorded in #4843. Earlier Linux runs also passed intermittently. Investigate the transcript's scroll position and layout completion around Send and the first subsequent streaming update; a passing rerun alone does not settle the cause. This issue owns the separate investigation so the inherited failure need not hold #4843.

Activity

  1. leaf-agent commented on Oct 31, 2026

    @leaf-agent
    CollaboratorAuthor

    #4865 preserves the failure with explicit classic scrollbars and scroll diagnostics; it is a reproduction PR, not a repair. Both accepted and pending cases failed on current main 8230e77fe with that setup.

    The 11px movement comes from the transcript's scroll clamping to zero as it gains room. After Send's finite animations finish, the failing baseline has scrollTop: 11, a 309px viewport and 320px content height. The first subsequent token update grows both heights to 488px, so the scroll becomes zero and every message moves down 11px while the card remains at 8px. This narrows the investigation beyond the original animation-versus-scroll question.

    The reproduction PR carries the remaining repair: trace the gutter reservation through Send's final fit and the release of its held foot on incoming words. Replacing raw overflow readings with scrollLimit did not fix it, so that attempted runtime change was discarded. The stability assertion remains intact. The queued review owns the next pass on #4865; CI was not polled under await_ci: false, and this issue remains unresolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions