Repository navigation
acpmux: _acpmux/queue_get reads a held prompt whole for the owner - #26855
Closed
teamleaderleo wants to merge 18 commits into
Closed
teamleaderleo wants to merge 18 commits into
teamleaderleo wants to merge 18 commits into
Conversation
Chat multiplayer, Share with guest (manaflow-ai/cmuxterm-hq#4766, first PR). A person's prompt whose author carries `approval: "owner"` (a link guest, `guest:<id>`) is queued, never steered in nor stopping the running turn, and the queue runs past it until the owner answers: - `_acpmux/queue_approve {sessionId, promptId, revision}` runs it in its place as a queued prompt; a stale revision is refused `queue.stale`. - `_acpmux/queue_decline {sessionId, promptId}` drops it; its session/prompt answers `queue.declined`. Both are owner-only (`queue.owner_only`) and held to Web control and the Full-access machine like a prompt. The guest may edit (a new revision, still waiting) or remove it; move, send now and interrupt are refused `queue.awaiting_owner`, and an edit after approval `queue.approved`. At most 16 wait per author (`queue.too_many_held`). Records: `queued` gains `awaitingOwner`/`revision`, new `queue_approved` and `queue_declined`; the queue summary exposes `awaitingOwner` and `revision`; a restart rebuilds it all from the log. Capability `queue-approval-v1`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?id=aid-c3300437b0af7f1bba36
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?id=aid-c3300437b0af7f1bba36
…ed in order Review of #26747: a restart applied an approval to a later prompt reusing the id, and an approval logged after the author's removal. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?id=aid-c3300437b0af7f1bba36
…e queue lock Restore applies queue_approved to the queued record with the same turn id, never to a later prompt that reuses a client-chosen prompt id. Approve and decline append their records under the queue lock that changes the queue, so the author's concurrent removal is always logged after them, and a late answer's decided reads the last decision for the prompt's latest incarnation. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?id=aid-c3300437b0af7f1bba36
…gent Review of #26747: a Send now racing the guest's prompt could set its steer flag, and nothing checked the hold where a steer is let out. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?id=aid-c3300437b0af7f1bba36
Send now, move and put_next check the hold under the queue lock that changes the prompt, not before it. queue_turn lets out no steer of a prompt that waits for the owner, take_queued leaves such a prompt in the queue (and clears its steer flag), and approval clears the steer flag, so an approved prompt runs in its place, never as a steer, whatever flag a race left on it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?id=aid-c3300437b0af7f1bba36
…t gone The queue_moved wake can reach the waiting task before its withdrawal; it then finds the prompt gone (take_queued) and answered withdrawn. It now answers queue.declined when the owner declined it. Seen flaking in a_declined_prompt_answers_declined_and_never_runs (3 of 8 runs). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?id=aid-c3300437b0af7f1bba36
…t stays the answer Review of #26747. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?id=aid-c3300437b0af7f1bba36
The owner's decline of a restored prompt settles its cached outcome (queue.declined); the restored task that then finds it gone answered withdrawn and overwrote it. Both writes now settle the outcome once: the first settled answer stays. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?id=aid-c3300437b0af7f1bba36
… spawned Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?id=aid-c3300437b0af7f1bba36
Review of #26747: an older peer ignores author.approval and would run the prompt unapproved. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?id=aid-c3300437b0af7f1bba36
…g queueApproval The forwarder refuses a prompt whose author carries approval, and _acpmux/queue_approve and _acpmux/queue_decline, with queue.approval_unsupported when the peer did not list queueApproval at its handshake: nothing is forwarded. Peer keeps the features it listed as one list (Peer::lists), which the attachment, upload and resume checks now read too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?id=aid-c3300437b0af7f1bba36
So peer.rs, over its size budget, does not grow. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?id=aid-c3300437b0af7f1bba36
A forwarded prompt also attaches the peer's session first. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?id=aid-c3300437b0af7f1bba36
Review of #26747: a move to an older build would restore the held prompt as an ordinary queued one and run it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?id=aid-c3300437b0af7f1bba36
- A move (transfer_begin) is refused transfer.held_prompts while any prompt waits for the owner, checked once the bundle is made, in the daemon: the destination may be an older build. Approve or decline it first. - A held prompt, and the owner's answer to one, forwarded to a peer go on the link that listed queueApproval (Peer::lists_on), never on one a reconnect brought since; a link's end clears its feature list before its epoch moves. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?id=aid-c3300437b0af7f1bba36
{sessionId, promptId} -> {promptId, turnId, revision, text, prompt (the full
blocks as it would run now), inlineParts, author, provenance, awaitingOwner};
queue.not_found with decided once it left the queue. Owner only
(queue.owner_only), under the Web-control check, and forwarded to a peer only
when it lists queueGet, on the link that listed it. Capability queue-get-v1.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?id=aid-c3300437b0af7f1bba36
…limit) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?id=aid-c3300437b0af7f1bba36
teamleaderleo
temporarily deployed
to
ci-routing-agent
October 28, 2026 11:39 — with
GitHub Actions
Inactive
teamleaderleo
temporarily deployed
to
ci-routing-agent
October 28, 2026 11:40 — with
GitHub Actions
Inactive
Collaborator
Author
|
Bead |
Collaborator
Author
|
cmux-ci receipt at
The generated TS is current (
|
teamleaderleo
temporarily deployed
to
sentry-dsyms
October 28, 2026 12:14 — with
GitHub Actions
Inactive
teamleaderleo
had a problem deploying
to
artifacts
October 28, 2026 12:14 — with
GitHub Actions
Failure
Collaborator
Author
|
Owned by an agent session · session |
Collaborator
Author
Collaborator
Author
teamleaderleo
added a commit
that referenced
this pull request
Nov 1, 2026
…rries #26855) (#29003) * acpmux: _acpmux/queue_get reads a queued prompt whole for the owner {sessionId, promptId} -> {promptId, turnId, revision, text, prompt (the full blocks as it would run now), inlineParts, author, provenance, awaitingOwner}; queue.not_found with decided once it left the queue. Owner only (queue.owner_only), under the Web-control check, and forwarded to a peer only when it lists queueGet, on the link that listed it. Capability queue-get-v1. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?id=aid-c3300437b0af7f1bba36 (cherry picked from commit 868904c) * acpmux: initialize advertises queue_get outside its json! (recursion limit) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?id=aid-c3300437b0af7f1bba36 (cherry picked from commit 68ac4b4) * acpmux: queue_get names a prompt's images with their sources (base renamed named to named_sourced) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?id=aid-049fca947e3297e5ccd3 --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This branch had an error being deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
HOLD: stacked on #26747; rebase and drop this line once it lands.
Leo (2026-10-28), on T3 Code's "Share with guest": "we want to be having, be able to do this kind of flow for CMux multiplayer ... we can work on the agent chat multiplayer." In that flow each message a guest sends waits for the owner, who approves or declines it. Before approving, the owner's pane needs the whole prompt: its words, its images and files, and the revision the approval names. This PR adds that read. Plan: manaflow-ai/cmuxterm-hq#4766.
Only the last commit is this PR's. Everything below it is #26747.
What it does
_acpmux/queue_get {sessionId, promptId}returns{sessionId, promptId, turnId, revision, text, prompt, inlineParts, author, provenance, awaitingOwner}for a prompt that is still in the queue:promptis the full content blocks as the prompt would run now, including the author's edits: images with their data, resource links, audio and files.revisionis the value_acpmux/queue_approveexpects.queue.not_found(-32002), withdata.decidedset the same wayqueue_approvesets it.queue_approve:queue.owner_only.queueGet, and sent on the link that listed it (Peer::lists_on). Otherwise it fails withqueue.approval_unsupportedand nothing is forwarded.queue-get-v1.docs/acpmux-schema.json, the README method list,spec/acpmux-protocol.json, and the TS types regenerated withbun scripts/acpmux-protocol-codegen.ts.queuedandqueue_updatedrecords peers already receive (peer_text.rsmasks only summaries).Risk
risk:low. A new read-only method that sits behind the same checks as
queue_approve. Nothing that exists changes behavior.Tests
hub_integrationprompt_approval::the_owner_reads_a_held_prompt_whole_at_its_revision. After the guest edits a held prompt that had an image and a file link,queue_getreturns the new text, the kept blocks, revision 1, its author and provenance. A caller with an author getsqueue.owner_only. After a decline, the prompt isqueue.not_foundwithdecided: "declined".peer_queue_approval:queueApprovalrefuses get, approve and decline.queueApprovalbut notqueueGetrefuses get, and nothing is forwarded.queueGetis forwarded the get.Changelog
none
Agent session: agent session
🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmith-botwith what you need.Summary by cubic
Adds owner approval for queued guest prompts in chatbot mode: a person's prompt waits for the owner, who approves or declines it, and can read the prompt whole before answering. Previously the owner only saw the queued preview; now they get full content blocks (including images and files), the current revision, and author/provenance info. Also blocks the prompt from reaching an older daemon that would run it unapproved.
Approval flow
_acpmux/queue_approveruns the prompt in its queue place at the revision the owner saw; a stale revision is refusedqueue.stale._acpmux/queue_declinedrops it and itssession/promptanswersqueue.declined.queue.owner_only), under the Web-control check and Full-access hold; the guest can edit (new revision, still waiting) or remove it.Access and forwarding
_acpmux/queue_getreturns the full blocks, revision, author, and provenance; once the prompt leaves the queue it returnsqueue.not_foundwith the samedecidedvalue asqueue_approve.queueApproval, on the link that listed it;queue_getrequiresqueueGet. Otherwisequeue.approval_unsupportedand nothing is forwarded.transfer.held_promptswhile any prompt waits for the owner, since an older build would run it unapproved.queue-approval-v1andqueue-get-v1.Written for commit 68ac4b4. Summary will update on new commits.