Skip to content

feat(buzz-acp): add auto permission mode - #2885

Open
skyerus wants to merge 2 commits into
block:mainfrom
skyerus:feat/acp-auto-permission-mode
Open

feat(buzz-acp): add auto permission mode#2885
skyerus wants to merge 2 commits into
block:mainfrom
skyerus:feat/acp-auto-permission-mode

Conversation

@skyerus

@skyerus skyerus commented Jul 25, 2026

Copy link
Copy Markdown

Closes #2884.

What this solves

buzz-acp can't be put into Claude Code's auto permission mode. PermissionMode has five variants and auto isn't one, so BUZZ_ACP_PERMISSION_MODE=auto fails clap validation at startup and the value never reaches the adapter — even though the adapter advertises it.

Probing claude-agent-acp 0.61.0 over ACP, session/new returns auto first in the mode config option:

   - auto | Auto
   - default | Manual
   - acceptEdits | Accept Edits
   - plan | Plan Mode
   - dontAsk | Don't Ask
   - bypassPermissions | Bypass Permissions

Why auto is the mode this harness wants

buzz-acp auto-approves every session/request_permission with allow_once (acp.rs:1068, acp.rs:1671), which is correct for a chat-driven harness — there's no human at a terminal, and forwarding a prompt would hang the turn.

The side effect is that default and acceptEdits become indistinguishable from bypassPermissions, leaving only plan and dontAsk as modes that constrain anything, and both are too restrictive for real work. auto is the missing middle: a classifier reviews each tool call, with no prompt for anyone to answer.

Implementation

Two lines of behaviour — the enum variant and its wire string:

/// Auto-approve tool calls, with a classifier reviewing each one.
#[value(alias = "auto")]
Auto,

// as_wire_str()
Self::Auto => "auto",

The #[value(alias = "auto")] form matches the existing style (Default and Plan carry the same redundant-but-explicit alias). Doc comments on the enum and on the --permission-mode arg updated to mention it.

Tests

Extended the four existing per-mode tests rather than adding new ones, so auto is covered everywhere the other five are:

  • test_permission_mode_wire_strings"auto"
  • test_permission_mode_is_default — not the default
  • test_permission_mode_value_enum_kebab_case"auto" parses
  • test_permission_mode_value_enum_camel_case_aliases — alias path
cargo test -p buzz-acp --lib permission_mode
test result: ok. 7 passed; 0 failed

cargo fmt -p buzz-acp -- --check clean. cargo clippy -p buzz-acp --lib --all-features produces no new warnings (the two it reports are pre-existing, both in queue.rs).

Testing it manually

BUZZ_ACP_PERMISSION_MODE=auto buzz-acp --relay-url … --private-key …

Startup log should read permission_mode=auto where it previously rejected the value.

Deferred

Not addressed here: whether the adapter honours auto identically to the interactive CLI. agentclientprotocol/claude-agent-acp#607 reports permissions.defaultMode: "auto" in settings.json having no effect, though that's a different mechanism from session/set_config_option — which is the path this uses and the one the adapter advertises. Worth verifying end-to-end before relying on the classifier as a security control.

@skyerus
skyerus requested a review from a team as a code owner July 25, 2026 19:51
claude-agent-acp advertises six values for the `mode` config option, with
`auto` first in the list:

    auto | default | acceptEdits | plan | dontAsk | bypassPermissions

`PermissionMode` omitted `auto`, so `BUZZ_ACP_PERMISSION_MODE=auto` failed
clap validation at startup and the value could never reach the adapter.

`auto` is the mode a headless harness actually wants. buzz-acp auto-approves
every `session/request_permission` with `allow_once`, which is correct — there
is no human at a terminal to answer one — but it means `default` and
`acceptEdits` are indistinguishable from `bypassPermissions` in practice, and
the only modes that constrain anything are `plan` and `dontAsk`, which are too
restrictive for real work. `auto` keeps a classifier reviewing each tool call
without requiring a prompt to be answered.

Tests cover the wire string, `is_default`, and both the kebab-case and
camelCase parse paths, matching the existing per-mode coverage.

Signed-off-by: Skye Gill <skyerusgill@gmail.com>
@skyerus
skyerus force-pushed the feat/acp-auto-permission-mode branch from a1c509a to bdfd18e Compare July 25, 2026 19:51
Co-authored-by: Phuoc (Phu) Do <91568955+dophsquare@users.noreply.github.com>
Signed-off-by: Phuoc (Phu) Do <91568955+dophsquare@users.noreply.github.com>

* origin/main: (111 commits)
  chore(ci): bump desktop smoke E2E timeout to 30 minutes (block#3409)
  release(chart): publish 0.1.7 (block#3393)
  feat(acp): steer claude-code and codex agents via _session/steering (block#3007)
  feat(desktop): apply WebKit rendering workarounds at startup on Linux (block#3271)
  fix(desktop): stabilize flaky DM expansion E2E ordering assertions (block#2004)
  docs(contributing): document the Linux system libraries just ci requires (block#3396)
  fix(desktop): paint community rail full height (block#3382)
  fix(acp): disable goose cron scheduler in managed agent children (block#3144)
  feat(desktop): add custom harness inline from agent dialogs (block#3252)
  chore(compose): remove stale typesense env vars (block#3332)
  feat(desktop): refine agent catalog sharing (block#2439)
  fix(desktop): keep drafts out of the Inbox All view (block#3217)
  docs: restructure DCO guidance into scannable subsection (block#3337)
  Unify mobile loading spinners (block#3314)
  fix(desktop): restore the inbox icon in the sidebar (block#3341)
  fix(desktop): gate codex-acp on a minimum supported version (block#3254)
  feat(cli): add users set-status command for NIP-38 profile status (block#3253)
  fix(composer): scope multiline block formatting (block#3246)
  feat(chart): add relay pod extension points (block#3322)
  Refine mobile attachment picking (block#3313)
  ...
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.

buzz-acp: no way to select Claude Code's auto permission mode — adapter advertises it, PermissionMode omits it

1 participant