Repository navigation
[ACP] Steer and queue prompts through session/prompt delivery - #10449
Conversation
Mid-turn user input now follows the ACP prompt delivery proposal. A
session/prompt with delivery "steer" joins the running turn at its next
safe point and "queue" starts a new turn after it; the request is answered
with {messageId} once the message is inserted. A delivery prompt to an idle
session starts a turn, reported by state_update session updates.
$/cancel_request withdraws a prompt not yet inserted, session/close and a
closed connection drop pending prompts, and session/cancel stops only the
running turn so pending steers open the next one. The session/inject
family is removed and session/pending_injections becomes
session/pending_prompts.
Allow-Protocol-Removal: ACP_AGENT_METHOD_SESSION_INJECT ACP_AGENT_METHOD_SESSION_REPLACE_INJECT ACP_AGENT_METHOD_SESSION_REVOKE_INJECT ACP_AGENT_METHOD_SESSION_PENDING_INJECTIONS ACP_DISPATCHED_METHOD_SESSION_INJECT ACP_DISPATCHED_METHOD_SESSION_REVOKE_INJECT ACP_DISPATCHED_METHOD_SESSION_REPLACE_INJECT ACP_DISPATCHED_METHOD_SESSION_PENDING_INJECTIONS ACP_HANDLED_METHOD_SESSION_INJECT ACP_HANDLED_METHOD_SESSION_REVOKE_INJECT ACP_HANDLED_METHOD_SESSION_REPLACE_INJECT ACP_HANDLED_METHOD_SESSION_PENDING_INJECTIONS sessionInject sessionPendingInjections sessionReplaceInject sessionRevokeInject
|
Ship: Landed. On main after 14 h 51 min. Remove the History (14)
|
Binary size
Release binary (
The debug binary is a growth proxy, not the shipped artifact: its bytes are never compared against the release baseline, only against main's debug binary built the same way. The release row is main's last real measurement. This check never fails a pull request. Only the distribution fuse can refuse a release, and only in |
|
Ship no longer needs you here. Now: Checks running. |
Split the hub's client-request ownership into its own module, box the delivery and drain futures out of the dispatch frame, poll the test gate without a wall-clock sleep, and expect the delivery capability in the packaged adapter E2E test.
|
The consumer canary on the first push was cancelled by the downstream job's 25-minute timeout during a cold build. That job is cancelled on other open PRs too, so it is unrelated to this change. It will be rerun once on this head. |
|
Ship no longer needs you here. Now: Waiting for review. |
kennethsinder
left a comment
There was a problem hiding this comment.
Reviewed the race fix: a drained prompt stays listed as admitting, cancel/close only flag it, and the turn makes one atomic claim under the list lock before admission, so it is the only responder and there is no double response or uncancellable window. The rest of the delivery cutover has been through the automated review rounds. Approving; the open thread still gates the merge.
|
Ship no longer needs you here. Now: Checks running. |
There was a problem hiding this comment.
Approved. No issues found.
The change replaces the ACP injection family with prompt delivery, insertion receipts, and turn-state updates. Reusing the session bridge queue serves that goal without creating a parallel input store; a separate host queue would duplicate delivery semantics. The wire break and the pending-request lifecycle are the main tradeoffs.
Details: 2 earlier fixed
Fixed at this head:
3b71da71783e0adf— At the cited current code,turn_startedonly sends a runningstate_update;PromptReceipts::insertedcallssend_receiptafter theAgentEvent::UserMessagenotification. The old early-receipt path is gone.05b31a078df6f5bf—handle_session_closecallsclose_deliverybeforecancel_pending_prompts;PendingPrompts::registerchecksclosedunder the same mutex and returns an error for a closing session, with the closure held through close.
Review run:
- 59 changed files; 0 carry a finding.
Mid-turn user input over ACP now follows the prompt delivery proposal (agentclientprotocol/agent-client-protocol#1261). A
session/promptwithdelivery: "steer"joins the running turn at its next safe point and"queue"starts a new turn after it. Either way the request is answered with{messageId}once the message is inserted, and turns started this way are reported bystate_updatesession updates.$/cancel_requestwithdraws a prompt that has not been inserted yet, andsession/closeor a closed connection drops pending prompts.session/cancelstops only the running turn, so pending steers open the next turn, which also makes "deliver now" a steer followed by a cancel. Thesession/injectfamily is removed with no shim, andsession/pending_injectionsbecomessession/pending_prompts.The one risk is a pipeline without an agent loop: it never reaches a checkpoint, so each waiting steer opens its own turn instead of joining the first one. ACP-server regression tests drive the real stdio adapter through these cases: mid-turn steer receipt at insertion, queue opening its own turn, idle delivery, unsupported delivery, withdrawal before and after insertion, cancel followed by the pending steer turn, missed steers opening one turn together, and the removed methods answering method-not-found. A live
harn serve acprun against a real model steered a multi-tool turn after its first tool call. The steer was inserted at the next safe point and answered before the turn ended, and a second run sent a steer plussession/canceland got the steer's own turn immediately.Allow-Protocol-Removal: ACP_AGENT_METHOD_SESSION_INJECT ACP_AGENT_METHOD_SESSION_REPLACE_INJECT ACP_AGENT_METHOD_SESSION_REVOKE_INJECT ACP_AGENT_METHOD_SESSION_PENDING_INJECTIONS ACP_DISPATCHED_METHOD_SESSION_INJECT ACP_DISPATCHED_METHOD_SESSION_REVOKE_INJECT ACP_DISPATCHED_METHOD_SESSION_REPLACE_INJECT ACP_DISPATCHED_METHOD_SESSION_PENDING_INJECTIONS ACP_HANDLED_METHOD_SESSION_INJECT ACP_HANDLED_METHOD_SESSION_REVOKE_INJECT ACP_HANDLED_METHOD_SESSION_REPLACE_INJECT ACP_HANDLED_METHOD_SESSION_PENDING_INJECTIONS sessionInject sessionPendingInjections sessionReplaceInject sessionRevokeInject