Skip to content

ACP sessions ignore permission mode changes on follow-ups until the session is rebuilt #4806

Closed

Description

@hxy91819

Version

desktop-v0.45.0 (129f621771a3e275773992db648316966ac207cf), provider-acp with any ACP agent (reproduced with Cursor via ACP and Codex via ACP).

Steps

  1. Start an ACP thread with permission mode accept-edits and let the first turn complete.
  2. Switch the thread's permission mode to full in the composer.
  3. Send a follow-up that needs a command or write the agent would have asked about.

Expected

The new permission mode applies to the next prompt, the way #4789 (Claude Code) and #4794 (Codex) now apply permission changes to follow-ups and steers.

Actual

The ACP agent keeps the mode the session was constructed with. The bridge only rebuilds the session when envVars changed or after a cancel error; the permissionMode carried on the follow-up request is never compared or passed into the resumed session:

: session.construction.envVars;
if (
session.restartAfterCancelError ||
!isDeepStrictEqual(envVars ?? {}, session.construction.envVars ?? {})
) {
const previousProviderThreadId = session.providerThreadId;
const reason = session.restartAfterCancelError
? "The ACP agent failed during cancellation; its session was rebuilt before continuing."
: "Execution settings changed; the ACP session was rebuilt to apply them.";
session = await startAgentSession({
kind: "resume",
params: { ...session.construction, envVars },
resumeProviderThreadId: previousProviderThreadId,

So permissionCli for the agent process still reflects the original mode until the thread is stopped and restarted.

What I ruled out

  • Not a UI state issue: the follow-up session/prompt request does carry the new permissionMode; the bridge ignores it on the resume path.
  • Not specific to one agent: the comparison is in the shared ACP bridge, before any dialect code.

Fork fix

Compare permissionMode alongside envVars when deciding whether to rebuild, pass it into the resumed session's construction params, and reject permissionMode: auto on ACP with a -32602 error since ACP has no equivalent and it would otherwise be silently treated as the previous mode. 2 files, +77/−3, with bridge tests for the rebuild and the rejection:

hxy91819/bb@desktop-v0.45.0...hxy91819:bb:fix/acp-permission-mode

Happy to turn this into a PR once I am on the contributor list.

AGENT GENERATED

Activity

  1. added a commit that references this issue on Oct 3, 2026
  2. added theissue type on Oct 3, 2026
  3. added
    providers
    provider-acp
    security
    confirmed-repro
    on Oct 3, 2026
  4. bb-slop-cop commented on Oct 3, 2026

    @bb-slop-cop
    Contributor

    🚨 SLOP COP 🚨 · new-issue-autopilot

    • Classification: Bug · Priority: Medium · Effort: Medium. Labels: providers, provider-acp, security, confirmed-repro.
    • Report: https://get-bb.github.io/reports/issues/4806.html
    • Verdict: REPRODUCED · root-cause confidence: high.
    • Root cause: Follow-up handling ignores the requested permission mode; environment-triggered reconstruction copies the original mode. Both agent launch flags and BB's approval policy remain stale, including automatic command approval after switching from full to accept-edits.
    • Verification: Five focused regression failures repeat in two clean checkouts of trusted main at cd12e7a9dfb3; 127 existing tests and the package typecheck pass. The report includes the complete reproduction test. Real Cursor/Codex processes and the composer UI were not exercised.
    • No PR: Repair changes permission enforcement, which the autopilot simple-fix policy excludes.
  5. added a commit that references this issue on Oct 5, 2026
    84bfe4b
  6. added a commit that references this issue on Oct 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    confirmed-reproprovider-acpproviderssecurity

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions