Repository navigation
Description
Is there an existing feature request for this?
- I have searched existing issues and feature requests, and this is not a duplicate.
Problem or Use Case
ACPAgent answers every session/request_permission from the ACP server by itself: _OpenHandsACPBridge.request_permission returns options[0], and the person using the conversation is never asked (acp_agent.py L1602–L1619 at 08af1d5).
I understand this is deliberate rather than a bug. The docstring says "Auto-approve all permission requests from the ACP server", the ACP guide says permission requests "are automatically granted", and the built-in Claude Code and Codex providers default to permission-skipping session modes. That is the right default for headless runs.
It leaves two gaps for anyone who wants a person in the loop, for example an interactive front end over Claude Code or Codex:
- There is no opt-in way to pass a permission request to the user. Choosing an
acp_session_modein which the server asks does not change the outcome, because the bridge answers before anyone sees the request. The comment inacp_providers.pysays the same: prompts never block regardless of mode. - The answer is chosen by position, not by
kind. Whatever the server lists first is selected, includingallow_alwaysor a reject option, and the log line still reads "ACP auto-approving permission".
Versions: openhands-sdk 1.49.1 (measured September 21), 1.49.6 and 1.51.0 (re-run October 3), and main at 08af1d5 (read; the function is unchanged).
Reproduction. Inert: it calls the handler directly, so no ACP server, model, network call or tool execution is involved.
# repro_acp_permission.py
import asyncio
from importlib.metadata import version
from acp.schema import PermissionOption, ToolCallUpdate
from openhands.sdk.agent.acp_agent import _OpenHandsACPBridge
CASES = {
"allow listed first": ["allow_once", "reject_once"],
"allow-always listed first": ["allow_always", "allow_once", "reject_once"],
"reject listed first": ["reject_once", "allow_once"],
}
async def main() -> None:
print("openhands-sdk", version("openhands-sdk"))
for label, kinds in CASES.items():
response = await _OpenHandsACPBridge().request_permission(
session_id="inert-session",
tool_call=ToolCallUpdate(tool_call_id="inert", title="inert probe"),
options=[PermissionOption(option_id=k, name=k, kind=k) for k in kinds],
)
print(f"{label}: selected {response.outcome.option_id}")
asyncio.run(main())$ uv run --with openhands-sdk==1.51.0 python repro_acp_permission.py
openhands-sdk 1.51.0
allow listed first: selected allow_once
allow-always listed first: selected allow_always
reject listed first: selected reject_onceThe same happens end to end. Through agent-server 1.49.1 and Agent Canvas 1.20.0, a stub ACP server that only sends one permission request (allow-once, then reject-once) and echoes the reply finished with {"outcome":{"optionId":"probe-allow-once","outcome":"selected"}}. Nobody clicked anything, and the conversation's event stream held no confirmation question.
Not measured: real Claude Code or Codex sessions in a non-bypass mode, and the order in which those servers list their options.
Desired Behavior
- Small: pick the automatic answer by
kindinstead of position. Preferallow_once, thenallow_always, and never select a reject option under an "auto-approving" log line. - Larger, opt-in: a setting on
ACPAgent(default unchanged) that, when enabled, publishes the pending permission request as an event, moves the conversation to the existingwaiting_for_confirmationstate, and resolves the ACP request with the option the user picks, or withcancelledon interrupt or timeout.
Headless use keeps today's behaviour in both cases.
Acceptance Criteria
- With default settings, permission requests are still answered automatically and never block a headless run.
- The automatic answer is chosen by option
kind; a reject option is never auto-selected. - With the opt-in enabled, a permission request appears as an event, the conversation waits, and the user's choice is returned to the ACP server as the selected
optionId. - Interrupting or pausing while a request is pending returns the ACP
cancelledoutcome. - An unknown, stale or repeated answer is rejected and never resolves a different request.
Alternatives Considered
- Relying on the ACP server's own session mode. It does not help: the bridge answers regardless of mode.
- Patching the private bridge from outside the SDK. I built a prototype this way against 1.49.1 and Agent Canvas 1.20.0 to check feasibility. Allow and Reject buttons in the UI returned the server's own
allow_onceandreject_onceoptions, an interrupt returnedcancelled, and missing or replayed request IDs were refused. It works, but it depends on private hooks, so it is not something to maintain outside the SDK.
Priority / Severity
Medium - Would improve experience
Estimated Scope
Medium - New feature with moderate complexity (the by-kind selection alone is small)
Feature Area
- Agent API / Core functionality
- Agent Server
Technical Implementation Ideas (Optional)
For the opt-in flow, the prototype kept one pending request per ACP session, keyed by a request ID carried on the published event, and resolved it from the existing confirmation endpoint. A maintained version would want a typed request-ID field and a dedicated permission event rather than reusing existing fields, plus defined behaviour for restarts and for overlapping requests.
Additional Context
I am happy to open a small pull request for the by-kind selection if that would be welcome, and to share the prototype notes for the opt-in flow. Thank you for the SDK, and for documenting the current behaviour so clearly.
Investigated and drafted with an AI coding agent; reviewed by me before posting.
Activity
all-hands-bot commentedon Oct 3, 2026
The following comments were added by the OpenHands AI agent.
Decision needed
Thanks for the detailed write-up. The by-
kindauto-selection is well specified and looks ready on its own, but the interactive opt-in flow changes the public SDK and agent-server API surface, and the repository's existing confirmation endpoint (POST /{conversation_id}/events/respond_to_confirmationwithConfirmationResponseRequest{accept, reason}) is accept/reject only — it cannot carry an ACPoptionId. Before this can be marked ready for development, I need the following decisions resolved:optionIddirectly (a new field on the confirmation/response request), or through a new SDK-level permission-selection model? Should the published request carry a typed request ID distinct from the ACPtool_call_idso a stale or replayed answer can be matched to exactly one request?kindauto-selection land as a standalone first PR, with the interactive opt-in designed separately? If the two must ship together, the whole issue stays blocked on the decisions below.cancelled), and what happens on restart/reconnect or an overlapping second permission request in the same ACP session — one pending request at a time, or a queue keyed by request ID?Once these are settled I can attach observable acceptance criteria and mark the issue ready.
LeonxLJX commentedon Oct 27, 2026
I'd like to take this one. The gap is in _OpenHandsACPBridge.request_permission — it unconditionally resolves to options[0], so every ACP permission request is auto-approved and there's no path to surface it to the human mid-run. Plan: add a configurable permission mode (keep auto as the default for headless), and when set to ask, route the request through the in-loop confirmation path instead of picking the first option; cover it with a test asserting the requested option is returned in ask mode. I'll open a draft PR shortly.
fix(acp): let ACP clients answer permission requests instead of alway…
LeonxLJX commentedon Oct 28, 2026
Hey - I've pushed a PR for this issue. The repo's PR description validator requires linked issues to carry the
eady-for-dev label (and for bug-fix PRs, the �ug label). Could you or a maintainer add $(System.Collections.Hashtable.missing) label(s) to this issue? That would let the PR CI pass the description check. Thanks!
jamesdwilson commentedon Nov 27, 2026
Thanks for documenting this and working on the opt-in path. We encountered the same limitation while validating human approval for a standalone ACP-backed OpenHands deployment.
Additional version evidence: on November 26, our installed
openhands-sdkreports 1.62.0. Inspection of its_OpenHandsACPBridge.request_permissionstill shows:This callback has no pending-human-decision branch. Its installed source SHA-256 is
0186adb760103c70761b9bf65335b4a7060e387c6b3f4dda73fcb486bdc1d568.Our practical integration gap is that configuring the conversation confirmation policy does not add a wait to this ACP callback. We therefore cannot accept this deployment as supporting human-gated ACP permissions yet.
Evidence boundary: this is installed-source inspection, not a newly reproduced end-to-end permission grant. An earlier AlwaysConfirm audit elicited no permission request, so it proves neither approval waiting nor an unauthorised tool execution. We deliberately did not trigger a sensitive action to manufacture a prompt.
I found the linked open PR #6265, so this seems better kept here than filed as a duplicate bug. Is that still the intended path for the opt-in approval flow? Thank you!
vibewrk commentedon Nov 27, 2026
@jamesdwilson Thanks for checking
1.62.0. The installed code shows why the conversation's confirmation policy doesn't make the ACP bridge wait for approval — once the opt-in flow lands, that needs a regression test sending an ACP permission request under a policy requiring confirmation.On #6265: no maintainer has weighed in yet, so the path isn't settled. As written it adds an in-process bridge callback; agent-server clients still need an API to receive and answer permission requests. I left specifics on the PR.
Concrete proposals for the triage questions above:
_OpenHandsACPBridge.request_permissionwith no public API change: prefer an offeredallow_once, thenallow_always(preserving offered order within each kind and returning the offeredoption_id); if neither is offered (empty or reject-only), return ACP'scancelledoutcome instead ofoptions[0]or a literal"allow_once", with unit tests. I'm happy to open that PR if maintainers agree on the split and @LeonxLJX doesn't want to include it in fix(acp): let ACP clients answer permission requests instead of always selecting the first option (#5480) #6265. (This doesn't close the confirmation-policy gap; that needs the opt-in flow below.)ConfirmationResponseRequest(which would allow contradictoryaccept=false+ allowoption_idstates). Publish thetool_callcontext and offeredoptionswith a server-generatedrequest_id(distinct from agent-controlledtool_call_id), and resolve once with either an offeredoption_idor explicit cancellation — rejecting unknown, stale, or replayed IDs. When the conversation policy requires confirmation, wait for a valid response or returncancelledif approval is unavailable.request_idso overlapping requests in the same ACP session can be answered independently. Interrupt/cancel (session/cancel) and any configured timeout resolve live pending requests ascancelled; pause leaves them pending. On a client reconnect while the bridge is alive, replay live pending requests. On a server/bridge restart, invalidate persisted pending IDs and reject late responses, since the in-flight ACP request is gone.Maintainers: would you prefer a separate issue for the by-
kindfix, or to track Part 1 here?