Skip to content

Agent chat: deleting a queued prompt leaves no gap under the last message - #22915

Merged
teamleaderleo merged 5 commits into
feat-cmux-nextfrom
cmux/queue-delete-gap
Oct 21, 2026
Merged

teamleaderleo merged 5 commits into
feat-cmux-nextfrom
cmux/queue-delete-gap

Conversation

@teamleaderleo

@teamleaderleo teamleaderleo commented Oct 21, 2026 •

Copy link
Copy Markdown
Collaborator

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 through queue_removed are named on the snapshot as queueWithdrawn (the last 16; model.ts adds 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 its queue_removed record: 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 be1570b) head
deleted queued prompt (4 cases) 4 fail 4 pass
deleted while the turn runs a tool (2 cases, test commit 694b674) fail on 95c33a6 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 07771e0, 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, all transcript-* files and ComposerQueue.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 base 78aaa620aa5 (2 of 2 runs each), so it is not caused by this PR.
  • scripts/web-lint.sh and prepush-gate.py pass. 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

teamleaderleo and others added 2 commits October 20, 2026 20:59
…t row

Red on base: the room a queued card leaves is held for a second for its
prompt to arrive as a row, but a withdrawn prompt never arrives. Both
orders of acpmux's queue update and its queue_removed record.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…leted

direct.ts names prompts that left the queue via queue_removed on the
snapshot (queueWithdrawn). VirtualTranscript keeps a leaving card's room
only for a prompt that was sent, or while the reply streams and fills it;
a withdrawal lets it go at once, also when it arrives after the queue
update.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@teamleaderleo teamleaderleo added the risk:normal Risk tier (docs/ci/risk-tiers.md) label Oct 21, 2026
@cursor

cursor Bot commented Oct 21, 2026

Copy link
Copy Markdown

Bugbot needs on-demand usage enabled

Bugbot uses usage-based billing for this team and requires on-demand usage to be enabled.

A team admin can enable on-demand usage in the Cursor dashboard.

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Bead cx-ca6j0 created for this PR by the cmux coordinator.

@github-actions

github-actions Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

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

Review 3aceacd: 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=pr22915 -f ref=cmux/queue-delete-gap -f platform=macos -f backend_mode=local

Yours to fix: agent-pane-stream-jitter.test.ts (a file this PR changes). Seen on other PRs too (likely flaky): agent-pane-adopted-tool-calls.test.ts, agent-pane-adopted-tool-calls.test.ts, agent-pane-column-edges.test.ts and 24 more. This PR merged before its CI finished: fix forward on main.

CI failed on 3aceacdae6 (run 39542720385 attempt 1): 4 code, 1 unknown.

Job Verdict Why
web / react-apps-check (2) code a web test failed
web / react-apps-check (4) code a web test failed
web / react-apps-check (3) code a web test failed
web / react-apps-check (1) code a web test failed
web / react-apps-check unknown no known signature; failed step: Check webview test shards

Failures:

  • seen on other PRs agent-pane-adopted-tool-calls.test.ts the adopted turn's Worked for opens to its commands and edited files: failed (job)
  • seen on other PRs agent-pane-adopted-tool-calls.test.ts a patch whose files only its input names counts each file, not one: failed (job)
  • seen on other PRs agent-pane-column-edges.test.ts the strip or queue and the card meet square in one rim, and the queue keeps room above: failed (job)
  • seen on other PRs agent-pane-wheel-pass-through.test.ts chromium > the wheel over a long draft stops at its ends and moves nothing else: failed (job)
  • seen on other PRs agent-pane-wheel-pass-through.test.ts webkit > the wheel over a long draft stops at its ends and moves nothing else: failed (job)
  • seen on other PRs composer-location-strip.test.ts the chat composer at 420 px: the strip's marks line up with the prompt's edges: failed (job)
  • seen on other PRs composer-location-strip.test.ts the chat composer at 760 px: the strip's marks line up with the prompt's edges: failed (job)
  • seen on other PRs agent-pane-queue-steer.test.ts queued and steering prompts > the queue takes its own place in the stack: nothing is cut off or draw...: failed (job)
  • seen on other PRs agent-pane-queue-steer.test.ts queued and steering prompts > Send now on a queued prompt keeps its row, reading Steering, until it ...: failed (job)
  • yours agent-pane-stream-jitter.test.ts webkit: scrolling up while a reply streams is never pulled back: failed (job)
  • ... 18 more in the job logs
Matched log lines
web / react-apps-check (2): (fail) the adopted turn's Worked for opens to its commands and edited files [31111.34ms]
web / react-apps-check (4): (fail) queued and steering prompts > the queue takes its own place in the stack: nothing is cut off or drawn over [1351.50ms]
web / react-apps-check (3): (fail) each delimiter typesets once math appears [82.38ms]
web / react-apps-check (1): (fail) queued prompts from the keyboard > ⌘Return sends a queued prompt now; Delete removes one [31091.60ms]

Not re-run automatically: web / react-apps-check (2), web / react-apps-check (4), web / react-apps-check (3), web / react-apps-check (1), web / react-apps-check are not machine failures.

Written by scripts/ci/classify_failures.py (ci-failure-attribution.yml); signatures are its SIGNATURES table. A machine verdict is the runner's fault, not this PR's; yours means the failing file is one this PR changes, also red on main that main's latest full suite fails the same way, seen on other PRs that it failed on another pull request's run lately.

red: web / Web status; base red: the same failure on the base 6c39334; does not block
red: web / react-apps-check; base red: the same failure on the base 6c39334; does not block
red: web / react-apps-check (1); base red: the same failure on the base 6c39334; does not block
red: web / react-apps-check (2); base red: the same failure on the base 6c39334; does not block
red: web / react-apps-check (3); NEW: { "source": "Area is $\pi r^2$ here.", - "tex": [ - "\pi r^2", - ], + "tex": [], } - Expected - 3 + Received + 1 at <anonymous> (/home/runner/_work/cmux/cmux/we is not red on the base 6c39334; do not merge until green; see lane-rules
red: web / react-apps-check (4); base red: the same failure on the base 6c39334; does not block

Tour of 3aceacdae6 (run): no media. The tour did not run: only webview code changed (4 path(s)), which the gallery advisory run checks in Linux Chromium on the pull request (its artifact holds any captures); add the media-tour-mac label to tour it on a Mac.

teamleaderleo and others added 3 commits October 20, 2026 21:11
…leaves no gap for long

Review of #22915: with the turn running but nothing streaming, the room
was still held for a second.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… grows

Held only for a withdrawn prompt, the room is released 250 ms after the
reply last grew (re-armed on each pass), so a turn in a tool call or
thinking does not keep a gap. Withdrawn ids are memoized per snapshot.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@teamleaderleo
teamleaderleo merged commit d8c03f5 into feat-cmux-next Oct 21, 2026
@teamleaderleo
teamleaderleo deleted the cmux/queue-delete-gap branch October 21, 2026 04:12
teamleaderleo added a commit that referenced this pull request Oct 21, 2026
Conflict only in App.tsx: base #22915 added queueWithdrawn to
VirtualTranscript, which this branch wraps in SubsessionContext. Kept
the wrapper and added the prop.

Agent-Session: 01a15ba9-9614-7832-8e39-d8ca0407c193
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

owner: 01a15c40-dc2e-7881-81fa-0b71a528cca3

@github-actions

Copy link
Copy Markdown
Contributor

Shipped in:

@github-actions

Copy link
Copy Markdown
Contributor

Shipped in:

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