acpmux: session queue list, remove and clear --from-agents
Leo, 2026-10-29: "are these messages literally not getting to you ... i literally can't stop you i clicked the stop button and it didnt do anything so this is still busted didnt we say we were going to fix this in acpmux? otherwise i have to manually just click steer on all of them unless you come up with better solulus"
A coordinator session had 319 queued prompts, every one from another agent, while its harness was unavailable. The only way to drop them was a hand-written _acpmux/queue_remove JSON-RPC call over the socket, and acpmux session info cuts each queued prompt to 200 characters. This PR adds a CLI for it.
What it adds
acpmux session queue (cmux-tui/crates/acpmux/src/cli/session_queue.rs):
list SESSION: one row per queued prompt, in run order, with prompt id, sender (the agent's name plus its bound session when the daemon has one, orperson), age, and a one-line preview.--jsonadds each prompt's fulltextfrom_acpmux/queue_text(#27519), one request per prompt.remove SESSION PROMPT_ID...: removes each named prompt and reports it asremoved,not_foundorrefused(with the daemon's reason). An unknown id fails the command (queue.not_removed) after the others have been removed.clear SESSION --from-agents [--dry-run]: removes only prompts that havefromAgentset. The person's own prompts and a teammate's prompts in a shared chat stay. Without--from-agentsit refuses and says why.--dry-runlists what it would remove and changes nothing. A prompt that leaves the queue during the clear (it ran) does not count as a failure.
It adds no new wire request. It reuses _acpmux/info (queue), _acpmux/queue_remove and _acpmux/queue_text. Removals take the same path the app's queue rows use, so the log records queue_removed and the daemon's own checks still apply (author.rs queue.not_author, a chat being moved, Full access by a machine). A host/name session is resolved once through resolve::control_id, like session resume, and its routed id goes to the peer daemon.
The README and the agent skill each list the new commands.
Risk
Low. The CLI is new and changes nothing in the daemon. clear can only remove agent messages, and the daemon still refuses any removal it would refuse from the app.
Tests (red, then green)
tests/session_queue_cli.rs runs a real daemon with the fake agent, keeps one turn running, queues the person's prompts and agents' prompts behind it, and runs the CLI:
list_json_gives_each_queued_prompts_full_text: an agent message of more than 1000 characters comes back whole in--json.clear_from_agents_leaves_the_persons_prompts: refuses without--from-agents, the dry run removes nothing, then only the person's prompt is left, and the log has aqueue_removedrecord for each removed prompt.remove_reports_unknown_ids: reportsremovedandnot_foundper id, exits non-zero, and then removes the person's own prompt.
| run | tree | result |
|---|---|---|
| 40967636816 | tests only, on base | red: all 3 fail (unrecognized subcommand 'queue') |
| 40967768997 | CLI without #27519 | remove and clear green; list red (no full text yet) |
| 40968925611 | this branch merged with #27519 (local trial) | green: 3/3 integration, 3/3 unit, clippy -D warnings clean |
| 40974199291 | head 52977a63, merged with base after #27519 | green: 3/3 integration, 3/3 unit, clippy -D warnings clean |
Builds on #27519 (_acpmux/queue_text, capability queue-text-v1), now in base. A prompt that leaves the queue between list and its queue_text read (queue.not_found) gets text: null plus a textError and does not fail the list.
Agent session: agent session
š¤ Generated with Claude Code