cmux link agent move: stop a running turn only where it goes on; never mid-compaction
Ā
TE
5d ago+69+69+01234567890123456789-1-1-0123456789
Follow-ups 2 and 3 of #30460, from the review of #30280 (receipt https://github.com/manaflow-ai/cmux/pull/30280#issuecomment-6555072858). That work is for cmuxterm-hq#5846 item 1. Leo, 2026-11-01: "those all seem good".
What changes
Since #30280, Move to Cloud and Bring Back Local always pass --interrupt, so a move stops a running turn and acpmux continues it where the chat lands. Two cases lost work:
- An older source daemon (an un-updated Cloud machine on Bring Back) stopped the turn and queued no continuation, so the turn ended for good. The daemon now lists
agent-transfer-continues-v1beside the transfer verbs. The pump (cmux link agent move) sendsinterruptonly to a source whoseidentifylists it. Any other source gets no Stop and refuses the move while the turn runs (transfer.busy), as before #30280. - A move while Claude compacts. The Stop's compaction branch (
cancel.rs) withdraws the person's queued prompts.transfer_beginwithinterruptnow refuses while the chat is compacting (transfer.busy: the chat is compacting; move it once that ends), before anything is logged or stopped. The check is the same onecancel.rsmakes.
spec/commands.md says both.
Tests
tests/link_agent_move.rsa_running_turn_is_stopped_only_on_a_source_that_continues_it: an older source's begin getsinterrupt: false, one that lists the capability getstrue, and with no flag it is never set.tests/cli/agent_session_start.rs: a daemon that serves transfer listsagent-transfer-continues-v1.
cmux-ci receipt below.
Follow-ups (from its review, kept in #30460)
- acpmux, not the daemon beside it, should say it continues a stopped turn: on a Cloud VM the two can update apart.
- An acpmux test of the compaction refusal.
- The narrow window between the compaction check and the Stop.
Changelog
none
š¤ Generated with Claude Code
Agent session: agent session
Summary by cubic
Fixes cmux link agent move so a move never stops a running turn unless the source's acpmux continues it where the chat lands, and never stops one mid-compaction.
- The daemon now lists
agent-transfer-continues-v1; the pump sendsinterruptonly to a source that lists it. An older source (an un-updated Cloud machine on Bring Back) would stop the turn for good, so there the move is refused while the turn runs, as before--interrupt. - A move with
--interruptis refused (transfer.busy: the chat is compacting) while the chat compacts, since the Stop would withdraw the person's queued prompts. - Both cases (and the capability) are documented in
spec/commands.md.