Skip to content

cmux NEXT composer: a failed upload tries again on the next key or click, never refused for lack of one - #32102

Merged
teamleaderleo merged 3 commits into
feat-cmux-nextfrom
lane/upload-retry-gesture
Nov 2, 2026
Merged

teamleaderleo merged 3 commits into
feat-cmux-nextfrom
lane/upload-retry-gesture

Conversation

@teamleaderleo

@teamleaderleo teamleaderleo commented Nov 2, 2026 •

Copy link
Copy Markdown
Collaborator

Leo: "idk what's going on with video attachments"

A screen recording's tile showed "The app refused the agent connection." with Retry.

Cause

The host starts a chat upload only with the person's fresh key or click: AgentPaneModel uploadStage spends that gesture at chat.upload.begin and answers gestureRequired (shown as "The app refused the agent connection.") without one. After a failed upload, the composer's first automatic retry (#30572) went out on a 1 s timer with no gesture. The gesture was already spent by the first begin, so the host always refused that retry. With no key or click in the next 15 s, the tile then showed the refusal and lost the upload's own error (for example "The upload timed out: the app did not answer.").

Fix

composer/uploadRetry.ts: every automatic retry now waits for the person's next key or click in the page (never Return, which keeps its gesture for the send), as the last retry already did. Where no document exists (a test host), the 1 s timer stays.

Test

cd webviews && bun test test/composer-upload-first-send.test.tsx

  • Red on base (6aaa616, test only): a failed upload never tries again without the person's gesture, and keeps its own words fails with refused = [2]. The 1 s retry went out with no gesture.
  • Green on head: 9 pass. The existing retry tests now drive the retry with the person's key.

Observed / Not run

  • Ran: the suite above, red then green; scripts/web-lint.sh (format and fast lints; this host leaves the type-aware lint to CI); prepush-gate.py; tsc, which reports no errors in the changed files.
  • Not run: a capture of the real app sending a recording.

Changelog

Fixed: a failed attachment upload tries again on your next key or click instead of showing "The app refused the agent connection."

No capture: no UI layout changes, only when a retry starts.

Agent session: agent session

🤖 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 failed attachment uploads so automatic retries wait for the person's next key or click instead of firing on a 1-second timer. The timer-based retry was always refused by the host ("The app refused the agent connection."), and that refusal replaced the upload's own error on its tile.

  • Every retry now waits for the person's next key or click in the page. Return and lone modifier keys (Shift, Control, Alt, Meta, CapsLock, Fn) never count, since the host records no gesture for them.
  • The 1-second timer remains only where no page exists (a test host).
  • Tests now restore their patched document listener on every path, including failures.

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

View guided diff Turn on auto-fix

teamleaderleo and others added 2 commits November 2, 2026 09:59
…s gesture

Red on base: the first automatic try again goes 1 s after the failure with no key or
click, the host refuses its begin (gestureRequired, "The app refused the agent
connection."), and that text replaces the upload's own error on its tile.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?id=aid-f9c38c84c6fe8afc010c
…key or click

The host starts an upload only with a fresh gesture (AgentPaneModel uploadStage spends it
at begin). The first automatic try again went on a 1 s timer with none, so it was always
refused as "The app refused the agent connection.", and that refusal replaced the
upload's own error on its tile. Every try again now waits for the next key or click
(never Return), as the last one already did.

Leo, 2026-10-31: "idk what's going on with video attachments"

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?id=aid-f9c38c84c6fe8afc010c
@github-actions

github-actions Bot commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

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

Review af39b72: 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=pr32102 -f ref=lane/upload-retry-gesture -f platform=macos -f backend_mode=local

Gallery before/after for af39b72: 16 states rendered, 0 images differ, 740 more touched states not rendered. Images are in the run's artifact, not on this public PR; the independent review of this head reads them on its own, so the PR needs no hand-made screenshots of these states.

gh run download 41425704449 -R manaflow-ai/cmux -n gallery-advisory-32102-af39b727bd0488af311a047f09712cd4da168939 (then read gallery-review.json)

States
State Theme Status Diff Picked by
agent-pane.attachment-source/before Apple System Colors Light unchanged 0% imports uploadRetry.ts (2 hops)
agent-pane.attachment-source/before Apple System Colors unchanged 0% imports uploadRetry.ts (2 hops)
agent-pane.attachment-source/corner Apple System Colors Light unchanged 0% imports uploadRetry.ts (2 hops)
agent-pane.attachment-source/corner Apple System Colors unchanged 0% imports uploadRetry.ts (2 hops)
agent-pane.attachment-source/small Apple System Colors Light unchanged 0% imports uploadRetry.ts (2 hops)
agent-pane.attachment-source/small Apple System Colors unchanged 0% imports uploadRetry.ts (2 hops)
agent-pane.attachment-source/labelled Apple System Colors Light unchanged 0% imports uploadRetry.ts (2 hops)
agent-pane.attachment-source/labelled Apple System Colors unchanged 0% imports uploadRetry.ts (2 hops)
agent-pane.attachment-source/outside Apple System Colors Light unchanged 0% imports uploadRetry.ts (2 hops)
agent-pane.attachment-source/outside Apple System Colors unchanged 0% imports uploadRetry.ts (2 hops)
agent-pane.composer/font-size-chat-14 Apple System Colors Light unchanged 0% imports uploadRetry.ts (2 hops)
agent-pane.composer/font-size-chat-14 Apple System Colors unchanged 0% imports uploadRetry.ts (2 hops)
agent-pane.composer/font-size-new-chat-14 Apple System Colors Light unchanged 0% imports uploadRetry.ts (2 hops)
agent-pane.composer/font-size-new-chat-14 Apple System Colors unchanged 0% imports uploadRetry.ts (2 hops)
agent-pane.composer/font-size-new-tab-14 Apple System Colors Light unchanged 0% imports uploadRetry.ts (2 hops)
agent-pane.composer/font-size-new-tab-14 Apple System Colors unchanged 0% imports uploadRetry.ts (2 hops)
agent-pane.composer/font-size-chat-21 Apple System Colors Light unchanged 0% imports uploadRetry.ts (2 hops)
agent-pane.composer/font-size-chat-21 Apple System Colors unchanged 0% imports uploadRetry.ts (2 hops)
agent-pane.composer/font-size-new-chat-21 Apple System Colors Light unchanged 0% imports uploadRetry.ts (2 hops)
agent-pane.composer/font-size-new-chat-21 Apple System Colors unchanged 0% imports uploadRetry.ts (2 hops)
agent-pane.composer/font-size-new-tab-21 Apple System Colors Light unchanged 0% imports uploadRetry.ts (2 hops)
agent-pane.composer/font-size-new-tab-21 Apple System Colors unchanged 0% imports uploadRetry.ts (2 hops)
agent-pane.composer/font-size-chat-28 Apple System Colors Light unchanged 0% imports uploadRetry.ts (2 hops)
agent-pane.composer/font-size-chat-28 Apple System Colors unchanged 0% imports uploadRetry.ts (2 hops)
agent-pane.composer/font-size-new-chat-28 Apple System Colors Light unchanged 0% imports uploadRetry.ts (2 hops)
agent-pane.composer/font-size-new-chat-28 Apple System Colors unchanged 0% imports uploadRetry.ts (2 hops)
agent-pane.composer-quote-persistence/ready Apple System Colors Light unchanged 0% imports uploadRetry.ts (2 hops)
agent-pane.composer-quote-persistence/ready Apple System Colors unchanged 0% imports uploadRetry.ts (2 hops)
agent-pane.composer-row/claude-auto Apple System Colors Light unchanged 0% imports uploadRetry.ts (2 hops)
agent-pane.composer-row/claude-auto Apple System Colors unchanged 0% imports uploadRetry.ts (2 hops)
agent-pane.composer-row/grid-running Apple System Colors Light unchanged 0% imports uploadRetry.ts (2 hops)
agent-pane.composer-row/grid-running Apple System Colors unchanged 0% imports uploadRetry.ts (2 hops)

Pick other states with a Gallery: entry.id, entry.id/variant line in the PR body.

red: cmux-next checks (god files, concurrency, crash safety, l10n); no finished base run on d2dd826 to compare; do not merge until green; see lane-rules

Shipped in:

The feat-cmux-next push run https://github.com/manaflow-ai/cmux/actions/runs/41425819578 at f22cb91 failed: cmux-next checks (god files, concurrency, crash safety, l10n).
Those jobs last passed at e836232. This pull request is one of 5 merged since: #28950, #32044, #32084, #31945, #32102.
If the failure is in your change, fix forward on feat-cmux-next. Pull requests run only the tiers their paths reach (docs/ci/cmux-next-tiers.md); label a batch PR full-ci to run them all before merging.

…; tests restore the input patch on every path

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?id=aid-f9c38c84c6fe8afc010c
@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Review (subagent claude-opus-5-5 medium): SHIP at af39b72

Checked: no retry path carries a batchToken. A retry is a new uploadToMachine call, so its begin needs a fresh gesture (AgentPaneModel uploadStage). The 1 s timer retry was therefore refused, and the refusal's text replaced the real error. Also checked: stop/cleanup on cancel, re-failure and give-up (no listener leaks), the chat-switch and carry scope checks, Return, key repeats and lone modifiers ignored, and the test's input patch restored in afterEach. bun test test/composer-upload-first-send.test.tsx passes 9 of 9.

Follow-ups:

  • [follow-up] A click on Send while a chip waits for its retry starts that retry, and its begin may spend the host's grant before the held send uses it. This was already possible on the last retry before this PR; it now covers every retry.

@blacksmith-sh

blacksmith-sh Bot commented Nov 2, 2026

Copy link
Copy Markdown

Found 6 test failures on Blacksmith runners:

Failures

Test View Logs
/tmp/tmp6zfo5qfd/summary-fail.json (live):/summary-fail.json (live): View Logs
/tmp/tmpn927_ack/summary-missing.json (live):/summary-missing.json (live): View Logs
[new_workspaces] debug.new_workspace timed 0 of 50 new workspace rows/
[new_workspaces] debug.new_workspace timed 0 of 50 new workspace rows
View Logs
[new_workspaces] the window draws no frames/[new_workspaces] the window draws no frames View Logs
[tabs] debug.tab_switch timed 0 of 40 switches/
[tabs] debug.tab_switch timed 0 of 40 switches
View Logs
[tabs] the window draws no frames/[tabs] the window draws no frames View Logs

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

This branch was previously deployed

1 inactive deployment
ci-routing-agent — af39b727 Deployed Nov 2, 2026 by teamleaderleo via wait for same-key tree publisher #100582
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