Repository navigation
acpmux: send --supersede KEY replaces your prompt still queued under KEY - #23733
Conversation
…prompt (red) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?harness=claude&session=01a15bfb-0a99-78c2-b078-ca1fc578ff04&host=cosmic-gray
…unts as run Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?harness=claude&session=01a15bfb-0a99-78c2-b078-ca1fc578ff04&host=cosmic-gray
…d under KEY Prompts queue behind running turns, so a lane read a correction after the order it corrected. session/prompt takes _meta.acpmux.supersede: the same sender's prompts still waiting under that key leave the queue (queue_removed reason superseded, supersededBy) and never run, across a restart too. A prompt whose turn started or that is being sent into the running turn stays. The acceptance carries replaced and replacedPromptIds; acpmux send prints "replaced N queued" and --json passes both through. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?harness=claude&session=01a15bfb-0a99-78c2-b078-ca1fc578ff04&host=cosmic-gray
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?harness=claude&session=01a15bfb-0a99-78c2-b078-ca1fc578ff04&host=cosmic-gray
|
cmux status (one comment, edited in place; each line is updated by the job that owns it) Review App of this head (app.zip, kept 1 day)
|
|
Owned by lane-host on cosmic-gray · session |
|
Bead |
…laces nothing; a steered one replaces (red) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?harness=claude&session=01a15bfb-0a99-78c2-b078-ca1fc578ff04&host=cosmic-gray
The review found the removal ran before the checks that can still refuse the new prompt: on a chat being moved the old order was withdrawn and the correction refused. Now a queued prompt replaces inside enqueue, under the queue lock that puts it in (after the moving and watched checks; two sends under one key can no longer both stay), one that starts at once when its turn starts, and a steer once it is recorded; the steer's fallback keeps the key. A forwarded keyed prompt names its sender session to the peer. The CLI says "replaced ?" when the daemon does not report a count. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?harness=claude&session=01a15bfb-0a99-78c2-b078-ca1fc578ff04&host=cosmic-gray
… ends the turn in seconds) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?harness=claude&session=01a15bfb-0a99-78c2-b078-ca1fc578ff04&host=cosmic-gray
Bugbot needs on-demand usage enabledBugbot 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. |
|
Found 1 test failure on Blacksmith runners: Failure
|
|
|
|
Review (independent subagent reviewer): SHIP at 3f27bc1 |
|
Shipped in:
|
…trust gate Codex review of #23921: - A daemon that stopped between the continuation's queued record and its queue_order restored it behind the queue; restore_queue now puts a daemon_restart continuation at the head (a later reorder still holds). - The continuation hard-coded trustGate false; turn_started now records the cut turn's trust gate and the continuation carries it (a log from before that checks a web turn again). - Images in the cut prompt or its steers were dropped; they are read back from attachments and sent again. prompt_supersede's restart test (from #23733, newer than this PR) turns restart continuation off: its until-cancel turn would otherwise run again ahead of the queue. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?harness=claude&session=01a167e2-7b7b-7aa3-8fcb-5b845bd68fdb&host=huge-blue
The supersede-after-restart test waited for the replacement's answer before resume_queues, so the restored continuation of the cut turn (ahead of it in the queue, as Leo asked: it resumes what it interrupted) never ran and the test deadlocked. Supersede itself was intact (replaced: 1). Resume first, then wait; also check the cut turn went on. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?harness=claude&session=01a167e2-7b7b-7aa3-8fcb-5b845bd68fdb&host=huge-blue
…trust gate Codex review of #23921: - A daemon that stopped between the continuation's queued record and its queue_order restored it behind the queue; restore_queue now puts a daemon_restart continuation at the head (a later reorder still holds). - The continuation hard-coded trustGate false; turn_started now records the cut turn's trust gate and the continuation carries it (a log from before that checks a web turn again). - Images in the cut prompt or its steers were dropped; they are read back from attachments and sent again. prompt_supersede's restart test (from #23733, newer than this PR) turns restart continuation off: its until-cancel turn would otherwise run again ahead of the queue. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?harness=claude&session=01a167e2-7b7b-7aa3-8fcb-5b845bd68fdb&host=huge-blue
The supersede-after-restart test waited for the replacement's answer before resume_queues, so the restored continuation of the cut turn (ahead of it in the queue, as Leo asked: it resumes what it interrupted) never ran and the test deadlocked. Supersede itself was intact (replaced: 1). Resume first, then wait; also check the cut turn went on. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?harness=claude&session=01a167e2-7b7b-7aa3-8fcb-5b845bd68fdb&host=huge-blue
…trust gate Codex review of #23921: - A daemon that stopped between the continuation's queued record and its queue_order restored it behind the queue; restore_queue now puts a daemon_restart continuation at the head (a later reorder still holds). - The continuation hard-coded trustGate false; turn_started now records the cut turn's trust gate and the continuation carries it (a log from before that checks a web turn again). - Images in the cut prompt or its steers were dropped; they are read back from attachments and sent again. prompt_supersede's restart test (from #23733, newer than this PR) turns restart continuation off: its until-cancel turn would otherwise run again ahead of the queue. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?harness=claude&session=01a167e2-7b7b-7aa3-8fcb-5b845bd68fdb&host=huge-blue
The supersede-after-restart test waited for the replacement's answer before resume_queues, so the restored continuation of the cut turn (ahead of it in the queue, as Leo asked: it resumes what it interrupted) never ran and the test deadlocked. Supersede itself was intact (replaced: 1). Resume first, then wait; also check the cut turn went on. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?harness=claude&session=01a167e2-7b7b-7aa3-8fcb-5b845bd68fdb&host=huge-blue
… queue behind it (#23921) * acpmux: a turn a daemon restart cut off resumes first, from the restored queue When the agent ended with the daemon, the new daemon settles the open turn outcome_unknown and queues one continuation at the head of the chat's queue: it quotes the cut turn's prompt and its steers, runs once across further crashes (prompt id <P>~resume-<n>, logged before the turn_result), and is recorded as auto_resume_scheduled reason daemon_restart. Agent-Session: 01a15ca9-5ac5-7692-adfc-a3ae828256ca Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?harness=claude&session=01a15ca9-5ac5-7692-adfc-a3ae828256ca&host=huge-blue * acpmux: a restart's continuation keeps its place, its images and its trust gate Codex review of #23921: - A daemon that stopped between the continuation's queued record and its queue_order restored it behind the queue; restore_queue now puts a daemon_restart continuation at the head (a later reorder still holds). - The continuation hard-coded trustGate false; turn_started now records the cut turn's trust gate and the continuation carries it (a log from before that checks a web turn again). - Images in the cut prompt or its steers were dropped; they are read back from attachments and sent again. prompt_supersede's restart test (from #23733, newer than this PR) turns restart continuation off: its until-cancel turn would otherwise run again ahead of the queue. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?harness=claude&session=01a167e2-7b7b-7aa3-8fcb-5b845bd68fdb&host=huge-blue * acpmux: #23733's restart test keeps restart continuation on The supersede-after-restart test waited for the replacement's answer before resume_queues, so the restored continuation of the cut turn (ahead of it in the queue, as Leo asked: it resumes what it interrupted) never ran and the test deadlocked. Supersede itself was intact (replaced: 1). Resume first, then wait; also check the cut turn went on. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?harness=claude&session=01a167e2-7b7b-7aa3-8fcb-5b845bd68fdb&host=huge-blue * acpmux: a Web-steered cut turn goes on as a Web turn, through the trust gate Codex re-review of #23921: the continuation took control and trust gate from turn_started alone, so a local turn a Web steer had raised (turn_control) went on as local with no folder-trust check. It now applies turn_control, and a Web continuation is always gated. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?harness=claude&session=01a167e2-7b7b-7aa3-8fcb-5b845bd68fdb&host=huge-blue * fix(acpmux): preserve remote floor across restart resume Agent-Session: https://cmux.com/deeplink/agent?harness=codex&session=01a16a58-a83b-70e3-8bbf-e5aadf9068ed&host=huge-blue * fix(acpmux): handle unrelated restart log records Agent-Session: https://cmux.com/deeplink/agent?harness=codex&session=01a16a58-a83b-70e3-8bbf-e5aadf9068ed&host=huge-blue * fix(acpmux): only apply restart floor to Web turns Agent-Session: https://cmux.com/deeplink/agent?id=aid-0c2d4e9433f05cabbb99 * fix(acpmux): adapt restart recovery to current queue APIs Agent-Session: https://cmux.com/deeplink/agent?id=aid-0c2d4e9433f05cabbb99 --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Leo Li <t@e>
![Fix with [code]smith](https://pr-comments-assets.blacksmith.sh/codesmith/fix-with-codesmith-light-3x.png)
What
acpmux send --supersede KEY: a prompt replaces the same sender's prompts still waiting in the queue under the same KEY.session/prompttakes_meta.acpmux.supersede(a non-empty string of at most 256 bytes; anything else is refused withsupersede.invalid).remove_queued):session/promptanswers withdrawn;queue_removedrecord saysreason: "superseded"andsupersededBy;queuedrecord, so a prompt restored after a restart can still be replaced.digest.rsagent_sender): an agent's name (--from, or the session the connection runs in), or the person.replaced(a count) andreplacedPromptIds.acpmux sendprintsreplaced N queuedunderqueued/steered.--jsonaddsreplacedandreplacedPromptIds.--supersedethe output is unchanged.Why
acpmux prompts queue behind running turns, often 3 to 6 deep, so a lane reads a correction after the order it corrects. That is how one of today's tasks bounced between ci-speed and machine-mesh three times.
Tests
Written first:
tests/hub_integration/prompt_supersede.rs(end to end through the protocol handler with the fake agent):Unit tests in
cli/output.rs:queue_promptwith a key replaces the earlier prompt, andsent_linesprintsreplaced N queued;_meta.Results on cmux16:
replaced, and a bad key ran).cargo test -p acpmux: every binary is ok, including 518 unit and 362 hub_integration tests.cargo clippy -p acpmux --all-targets -- -D warningsis clean.cargo fmt --checkpasses after 4a3e141.No overlap with acpmux-unify's open PRs: #23027 and #23598 don't touch the queue or the prompt path.
Agent session: cosmic-gray
🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmith-botwith what you need.Summary by cubic
Adds
acpmux send --supersede KEYso a correction replaces the same sender's prompts still queued under KEY instead of being read after the order it corrects.Behavior
session/promptanswers withdrawn, thequeue_removedrecord saysreason: "superseded"andsupersededBy, and a restart never runs them; a key survives a restart, so a restored prompt can still be replaced.--from, or the session the connection runs in); a forwarded keyed prompt names that session to the peer. Editing a waiting prompt drops its key._meta.acpmux.supersedemust be a non-empty string of at most 256 bytes; anything else is refused withsupersede.invalid.acpmux sendprintsreplaced N queued(replaced ? queuedfrom a daemon that predates the key);--jsonaddsreplacedandreplacedPromptIds. Without--supersedethe output is unchanged.Written for commit 3f27bc1. Summary will update on new commits.