Skip to content

[ACP] Steer and queue prompts through session/prompt delivery - #10449

Merged
burin-labs-agent merged 10 commits into
mainfrom
acp-prompt-delivery
Oct 25, 2026
Merged

burin-labs-agent merged 10 commits into
mainfrom
acp-prompt-delivery

Conversation

@burin-labs-agent

Copy link
Copy Markdown
Contributor

Mid-turn user input over ACP now follows the prompt delivery proposal (agentclientprotocol/agent-client-protocol#1261). A session/prompt with delivery: "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 by state_update session updates. $/cancel_request withdraws a prompt that has not been inserted yet, and session/close or a closed connection drops pending prompts. session/cancel stops only the running turn, so pending steers open the next turn, which also makes "deliver now" a steer followed by a cancel. The session/inject family is removed with no shim, and session/pending_injections becomes session/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 acp run 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 plus session/cancel and 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

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
@burin-labs-agent burin-labs-agent added the ship Ship this pull request with the Smart Ship shepherd label Oct 24, 2026
@harn-release-bot

harn-release-bot Bot commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

Ship: Landed. On main after 14 h 51 min. Remove the ship label to stop.

History (14)
  • 2026-10-25 11:31 UTC Landed: On main after 14 h 51 min.
  • 2026-10-25 11:09 UTC Checks running: Waiting for the required checks to finish.
  • 2026-10-25 10:55 UTC Waiting for review: Waiting for the reviewer to finish.
  • 2026-10-25 10:30 UTC Checks running: Waiting for the required checks to finish.
  • 2026-10-25 10:29 UTC Needs you: Fix the failing checks on this pull request. Shipping continues by itself once that is done. Shipping couldn't finish this automatically. The automatic fix reported: The agent stopped before finishing this turn (internal reason: completion unverified).
  • 2026-10-25 09:17 UTC Checks running: Waiting for the required checks to finish.
  • 2026-10-25 02:33 UTC Waiting for review: Waiting for the reviewer to finish.
  • 2026-10-25 00:26 UTC Needs you: Address the review feedback on this pull request. Shipping continues by itself once that is done. Shipping couldn't finish this automatically. The automatic fix reported: The agent ran past the overall time limit for this turn before finishing.
  • 2026-10-24 23:22 UTC Waiting for review: Waiting for the reviewer to finish.
  • 2026-10-24 23:13 UTC Checks running: Waiting for the required checks to finish.
  • 2026-10-24 23:08 UTC Checks failed: Some required checks failed. Open the pull request to inspect the failing checks.
  • 2026-10-24 22:47 UTC Checks running: Waiting for the required checks to finish.
  • 2026-10-24 21:10 UTC Needs you: Fix the failing checks on this pull request. Shipping continues by itself once that is done. Shipping couldn't finish this automatically. The automatic fix reported: The agent stopped before finishing this turn (internal reason: completion unverified).
  • 2026-10-24 20:40 UTC Checks running: Waiting for the required checks to finish.

@github-actions

github-actions Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

Binary size

Measure Value
Debug harn (this PR) 943106112 bytes (899.41 MiB)
Debug harn (main 38aca0736676) 943058376 bytes (899.37 MiB)
Change +47736 bytes (+0.04 MiB, +0.00%)

Release binary (x86_64-unknown-linux-gnu, main 4114b6f0fe3f)

Measure Value
Size 239469744 bytes (228.37 MiB)
Versus the 0.10.141 baseline -16982360 bytes (-6.62%), growth signal not-comparable
Distribution fuse headroom 45742928 bytes (43.62 MiB, 16% of the 272.00 MiB ceiling)

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 build-release-binaries.yml.

harn-release-bot[bot]

This comment was marked as outdated.

@harn-release-bot

harn-release-bot Bot commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

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.
@burin-labs-agent

Copy link
Copy Markdown
Contributor Author

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.

harn-release-bot[bot]

This comment was marked as outdated.

harn-release-bot[bot]

This comment was marked as outdated.

@harn-release-bot

harn-release-bot Bot commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

Ship no longer needs you here. Now: Waiting for review.

harn-release-bot[bot]

This comment was marked as outdated.

@kennethsinder kennethsinder left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

harn-release-bot[bot]

This comment was marked as outdated.

@harn-release-bot

harn-release-bot Bot commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

Ship no longer needs you here. Now: Checks running.

harn-release-bot[bot]

This comment was marked as outdated.

@harn-release-bot harn-release-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_started only sends a running state_update; PromptReceipts::inserted calls send_receipt after the AgentEvent::UserMessage notification. The old early-receipt path is gone.
  • 05b31a078df6f5bf — handle_session_close calls close_delivery before cancel_pending_prompts; PendingPrompts::register checks closed under 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.

@burin-labs-agent
burin-labs-agent enabled auto-merge (squash) October 25, 2026 11:27
@burin-labs-agent
burin-labs-agent merged commit 5f0470f into main Oct 25, 2026
104 of 107 checks passed
@burin-labs-agent
burin-labs-agent deleted the acp-prompt-delivery branch October 25, 2026 11:31
@harn-release-bot harn-release-bot Bot removed the ship Ship this pull request with the Smart Ship shepherd label Oct 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants