Agent chat: deleting a queued prompt leaves no gap under the last message
Summary
Follow-up to #22858. When a queued prompt was deleted from the queue (acpmux queue_removed), the agent chat kept a card-high gap under the last message for up to 1 s, then glided down. #22858 holds the room a leaving queue card frees so that a sent prompt (dequeued) can arrive as a row without the view moving down. A deleted prompt never arrives, so that room was held for nothing.
direct.ts: prompts that leave the queue throughqueue_removedare named on the snapshot asqueueWithdrawn(the last 16;model.tsadds the optional field).VirtualTranscript(App.tsx): it notes which cards (.acpmux-queued[data-prompt-id]) left the stack. It keeps their room only for a prompt that was sent, or while a reply is streaming, since the growing reply fills that room. If no reply is streaming, a withdrawal lets the room go at once. Held only for a withdrawn prompt, the room is released 250 ms after the reply last grew, so a turn busy in a tool call or thinking doesn't keep a gap either (from review). That also works when acpmux's queue update arrives before itsqueue_removedrecord: the room is held for a frame or two, then released when the record lands.
The queue card itself (ComposerQueue.tsx, its CSS) is untouched. #22854 (prompt-queue-edit) owns it; I told that lane this PR only reads .acpmux-queued[data-prompt-id].
Testing
Command: cd webviews && CMUX_BROWSER_TESTS=1 bun test test/agent-pane-stream-jitter.test.ts
New case "a deleted queued prompt leaves no gap under the last row". It runs in Chromium and WebKit, once with the queue_removed record first and once with the queue update first. 300 ms after the card leaves, the last row must sit where it rested before the card came, and the view must be at its end.
base 78aaa620aa5 (test commit be1570bbc48) | head | |
|---|---|---|
| deleted queued prompt (4 cases) | 4 fail | 4 pass |
| deleted while the turn runs a tool (2 cases, test commit 694b674cd9c) | fail on 95c33a612f3 | pass |
| the rest of the file (6 cases from #22858) | pass | pass |
Observed / Not run
- Independent review subagent: PASS. Its one real finding (the gap stayed during a running turn with nothing streaming) is fixed in 07771e01322, which has a regression test.
- Ran on cmux16 (Playwright Chromium and WebKit): the file above (10 pass) plus
agent-pane-chat-column,-queue-steer,-bottom-stack,-follow-live,-scrollbar-full-height,-wheel-pass-through, alltranscript-*files andComposerQueue.test.tsx: 138 pass, 1 fail. The failing case,agent-pane-queue-steer"Send now on a queued prompt keeps its row, reading Steering, until it runs", also fails on base78aaa620aa5(2 of 2 runs each), so it is not caused by this PR. scripts/web-lint.shandprepush-gate.pypass. Web-only: no Swift or Rust.- Not run: the native app.
Changelog
Fixed: Deleting a queued prompt in the agent chat no longer leaves a gap under the last message for a second
Agent session: cmux16
🤖 Generated with Claude Code