Skip to content

fix(acpmux): a removed peer releases its waiting uploads at once (carry #30771) - #31536

Closed
teamleaderleo wants to merge 4 commits into
feat-cmux-nextfrom
lane/e06a-30771
Closed

teamleaderleo wants to merge 4 commits into
feat-cmux-nextfrom
lane/e06a-30771

Conversation

@teamleaderleo

@teamleaderleo teamleaderleo commented Nov 2, 2026 •

Copy link
Copy Markdown
Collaborator

Carries #30771 (a ChatGPT draft), rebased onto current feat-cmux-next with its commits unchanged.

Leo: "oh btw i talked with chatgpt and they raised a bunch more drafts and issues across cmuxterm-hq, cmux, and cmux-platform. some stuff worth looking at"

What

An upload forwarded to a peer that is reconnecting waits up to 30 s for the link (await_upload_link). On base it woke only when a connect attempt settled or when the deadline passed. Peer::stop() (remove/replace) bumped neither, so every pending upload to a removed peer sat for the full 30 s.

  • Peer gets a stop_changed watch channel that stop() latches to true. A stopped peer is never restarted: re-adding a peer makes a new Peer.
  • await_upload_link also waits on that channel and reports not ready once the peer has stopped.
  • forward_inner returns peer.unreachable_error() when the wait ends without a link. Before, it fell through to the feature checks against a cleared link.
  • Regression test: server::peer_forward::tests::removed_peer_wakes_all_waiting_uploads_without_a_connect_attempt.

Leo-ask: ask-e06a62154f

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 uploads waiting on a removed or replaced peer so they stop immediately instead of sitting for the full 30-second reconnect timeout.

  • Peer::stop() now broadcasts via a watch channel that the peer is stopped; await_upload_link wakes on that signal and reports not ready.
  • forward_inner returns peer.unreachable_error() when the wait ends because the peer stopped, rather than falling through to feature checks against a cleared link.
  • Adds a regression test that verifies removal wakes all pending uploads without any connect attempt.

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

View guided diff Turn on auto-fix

@cursor

cursor Bot commented Nov 2, 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 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 d10fdd3: 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=pr31536 -f ref=lane/e06a-30771 -f platform=macos -f backend_mode=local

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

@github-actions github-actions Bot added the risk:normal Risk tier (docs/ci/risk-tiers.md) label Nov 2, 2026
@blacksmith-sh

blacksmith-sh Bot commented Nov 2, 2026

Copy link
Copy Markdown

Found 10 test failures on Blacksmith runners:

Failures

Test View Logs
/tmp/tmp738btnxa/summary-missing.json (live):/summary-missing.json (live): View Logs
/tmp/tmpz6p1xaco/summary-fail.json (live):/summary-fail.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
imported web bundle inputs are not routed:/imported web bundle inputs are not routed: View Logs
test_every_part_of_bun_run_check_runs_in_the_warn_branch (main.WebviewsWarnSplitCov
ersCheck.test_every_part_of_bun_run_check_runs_in_the_warn_branch)/
test_every_part_of_bun_run_check_runs_in_the_warn_branch (main.WebviewsWarnSplitCov
ersCheck.test_every_part_of_bun_run_check_runs_in_the_warn_branch)
View Logs
test_the_repository_keeps_leo_bans (main.LeoBansTests.test_the_repository_keeps_leo
_bans)/
test_the_repository_keeps_leo_bans (main.LeoBansTests.test_the_repository_keeps_leo
_bans)
View Logs
test_the_repository_keeps_leo_bans (main.LeoBansTests.test_the_repository_keeps_leo
_bans)/
test_the_repository_keeps_leo_bans (main.LeoBansTests.test_the_repository_keeps_leo
_bans)
View Logs

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

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Review (codex gpt-6-astra high, next-review): SHIP at d10fdd3

SHIP at d10fdd3

Visual verdict: unchanged by this diff

Inspected peer stop signaling, upload wait races, forwarding behavior, and the regression test.

Follow-ups: none

@cmux-bot cmux-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cmux-bot approves d10fdd3: an independent review passed this exact head (next-review receipt by teamleaderleo). A push needs a new review; a later BLOCK at this head dismisses this approval.

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Closing as superseded. The original #30771 merged into feat-cmux-next as 36b83c2. Base also already has this carry's follow-up: forward_inner in peer_forward.rs returns peer.unreachable_error() when await_upload_link resolves not-ready. Once base is merged in, the only conflict left is rustfmt in one test, and the branch adds nothing.

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Review (codex gpt-6-astra high, sweep, via the review router; full diff from merge base d63ac15 to this head): SHIP at d10fdd3

No P1/P2 findings.

This branch was previously deployed

3 inactive deployments
ci-routing-agent — d10fdd34 Deployed Nov 2, 2026 by github-actions[bot] via cmux-next macOS placement #60725
artifacts — d10fdd34 Deployed Nov 2, 2026 by teamleaderleo via publish tree-addressed cmux-tui #98117
sentry-dsyms — d10fdd34 Deployed Nov 2, 2026 by teamleaderleo via upload cmux-tui dSYMs to Sentry #98117
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