Skip to content

Agent pane: a message sent mid-turn never leaves Return and Send dead - #22732

Merged
teamleaderleo merged 2 commits into
feat-cmux-nextfrom
cmux/composer-caret
Oct 21, 2026
Merged

teamleaderleo merged 2 commits into
feat-cmux-nextfrom
cmux/composer-caret

Conversation

@teamleaderleo

@teamleaderleo teamleaderleo commented Oct 21, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Leo could not send in a lane chat while its agent was mid-turn: the text stayed in the composer, Send looked ready, and both Return and clicking Send did nothing.

Cause: the composer holds a sent prompt until acpmux takes it (accepted), and while it holds one, Return and Send are no-ops with no feedback. The pane only learned a queued prompt was taken from acpmux's queued event record. A lagged event stream drops records, so the prompt sat in the field with Return and Send dead until the turn ended. Clicking Send failed the same way, which rules out Caps Lock / IME composition (the click path never reads keys).

Fix:

  • A prompt sent behind a running turn is taken as soon as the pane draws it in the queue. That row is the visible confirmation; a later refusal (including a folder-trust refusal) comes back as its bubble with Retry instead of deleting the prompt.
  • The pane also listens for _acpmux/prompt_accepted, which acpmux sends straight to the sending connection, so a lagged event stream no longer matters.
  • Return or Send while a prompt is still on its way now says "Still sending your last message. It stays here until the agent takes it." (21 locales) instead of doing nothing.

Testing

Regression first, from webviews/: bun test src/agent-session/acpmux/promptAccepted.test.ts

  • Base (6bb0037d, test only): 2 fail. The queue row shows, but accepted never runs (without the queued record, and with only prompt_accepted).
  • Head: 2 pass; heldPromptGesture.test.ts still passes.

Observed / Not run

  • Ran: the two test files above; vp fmt --check and vp lint (type-aware) on the changed TS files, clean.
  • Not run: the full bun run check and scripts/web-lint.sh / prepush gate locally. Git on cosmic-gray was hung (about 190 git processes stuck in uninterruptible I/O on the shared object store), so these commits were made through the GitHub API; CI's web lint job covers the full check. Not dogfooded in a tagged build.

Changelog

Fixed: A message sent while the agent is working no longer gets stuck in the composer with Return and Send doing nothing.

Agent session: cosmic-gray

🤖 Generated with Claude Code


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.


Summary by cubic

Fixes the agent pane composer so a message sent while the agent is mid-turn never gets stuck with Return and Send dead. The composer held the prompt until acpmux's queued event record arrived, and a lagged event stream can drop that record, leaving the typed prompt in the field with Return and Send doing nothing until the turn ended.

  • A prompt sent behind a running turn is now taken as soon as it's drawn in the queue; a later refusal comes back as its bubble with Retry.
  • The pane also listens for acpmux's _acpmux/prompt_accepted, which reaches the sending connection even when the event stream lags.
  • Pressing Return or Send while the last prompt is still on its way now shows a note explaining the message stays in the composer.

Written for commit d2b6517. Summary will update on new commits.

View guided diff Turn on auto-fix

teamleaderleo and others added 2 commits October 20, 2026 18:32
…dead

The composer held a sent prompt until acpmux's `queued` record reached the pane; a lagged
event stream drops it, so the prompt sat in the field and Return and Send did nothing until
the turn ended. A prompt drawn in the queue is now taken at once (a refusal comes back as its
bubble with Retry), `_acpmux/prompt_accepted` also takes it, and a press while one is still
sending says so instead of doing nothing.

Agent-Session: https://cmux.com/deeplink/agent?harness=claude&session=01a15bf1-fdac-78a0-ac2e-a38c001e9b1e&host=cosmic-gray
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@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.

@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 d2b6517: 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=pr22732 -f ref=cmux/composer-caret -f platform=macos -f backend_mode=local

Unclear: web / react-apps-check (1) failed: no known signature; failed step: Fail on the gate checks. This PR merged before its CI finished: fix forward on main.

CI failed on d2b65175ff (run 39527947619 attempt 1): 2 code, 2 unknown.

Job Verdict Why
web / react-apps-check (4) code a web test failed
web / react-apps-check (1) unknown no known signature; failed step: Fail on the gate checks
web / react-apps-check (2) 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-math.test.tsx each delimiter typesets once math appears: failed (job)
  • seen on other PRs transcript-fling.test.ts fast flings and uneven drags keep the view covered: failed (job)
  • seen on other PRs agent-pane-background-tasks.test.ts clicking a background task's end opens its terminal beside the chat: failed (job)
Matched log lines
web / react-apps-check (4): (fail) each delimiter typesets once math appears [85.02ms]
web / react-apps-check (2): (fail) clicking a background task's end opens its terminal beside the chat [895.89ms]

Not re-run automatically: web / react-apps-check (4), web / react-apps-check (1), web / react-apps-check (2), 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 0c490ba; does not block
red: web / react-apps-check; no finished base run on 0c490ba to compare; do not merge until green; see lane-rules
red: web / react-apps-check (1); no finished base run on 0c490ba to compare; do not merge until green; see lane-rules
red: web / react-apps-check (2); no finished base run on 0c490ba to compare; do not merge until green; see lane-rules
red: web / react-apps-check (4); no finished base run on 0c490ba to compare; do not merge until green; see lane-rules

Tour of d2b65175ff (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

Copy link
Copy Markdown
Collaborator Author

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

@blacksmith-sh

blacksmith-sh Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

Found 6 test failures on Blacksmith runners:

Failures

Test View Logs
test/agent-pane-background-tasks.test.ts/agent-pane-background-tasks.test View Logs
test/agent-pane-background-tasks.test.ts/agent-pane-background-tasks.test View Logs
test/agent-pane-math.test.tsx/agent-pane-math.test.tsx View Logs
test/agent-pane-math.test.tsx/agent-pane-math.test.tsx View Logs
test/transcript-fling.test.ts/transcript-fling.test View Logs
test/transcript-fling.test.ts/transcript-fling.test View Logs

Fix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

@teamleaderleo
teamleaderleo merged commit a663331 into feat-cmux-next Oct 21, 2026
@teamleaderleo
teamleaderleo deleted the cmux/composer-caret branch October 21, 2026 01:44
@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

cmux-next guards / defaults-snapshot is red on 21 of 21 fresh feat-cmux-next PR heads in the last 2:00:00, so it is most likely a base red, not this PR's. The base-reds lane has it; a base merge picks up the fix once it lands.

@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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant