Skip to content

fix: prefer one-time ACP permission approvals - #31687

Draft
dylanhuff-at-coder wants to merge 1 commit into
mainfrom
fix/agentacp-prefer-allow-once
Draft

dylanhuff-at-coder wants to merge 1 commit into
mainfrom
fix/agentacp-prefer-allow-once

Conversation

@dylanhuff-at-coder

Copy link
Copy Markdown
Contributor

The agent-local ACP client (agent/x/agentacp/client.go) answers every session/request_permission automatically and preferred allow_always options over allow_once. Harnesses can attach durable side effects to "always" options:

  • Claude Code's adapter (claude-agent-acp) turns "always" approvals into allow rules saved to userSettings, projectSettings, or localSettings. These rules persist in the workspace after the ACP session ends and also affect interactive use of the harness.
  • On ExitPlanMode, the adapter's first allow_always option is "Yes, clear context and use auto mode" (or bypass permissions). Coder picked it, so a subagent that planned first lost its context and escalated its permission mode. The allow_once option on the same prompt is "Yes, manually approve edits".

This change selects allow_once when the harness offers it and falls back to allow_always only when no one-time option exists. The documented auto-approve behavior is unchanged. The ACP subagents page now says Coder prefers one-time approvals.

This PR does not change whether ACP permission requests are approved automatically. That is the larger question: harness gates such as Pi extension confirm/select prompts (mapped to ACP permission requests by pi-acp) are still answered without the chat owner, and harness tool calls don't pass through pre_tool_use lifecycle hooks. That needs a product decision and is tracked separately.

🤖 Generated with Claude Code

The agent-local ACP client auto-approves permission requests and
preferred "always" options. Harnesses can attach durable side effects
to those options: Claude Code's adapter saves allow rules to its
settings files, and its plan-exit "always" options clear the session
context and switch to auto or bypassPermissions mode.

Select the one-time approval when one is offered and fall back to an
"always" option only when no one-time option exists.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
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.

1 participant