Skip to content

fix(acp): enforce bb permission modes for OpenCode - #5816

Merged
SawyerHood merged 1 commit into
acp-fu-4-skill-chipsfrom
acp-fu-5-opencode-permissions
Oct 20, 2026
Merged

SawyerHood merged 1 commit into
acp-fu-4-skill-chipsfrom
acp-fu-5-opencode-permissions

Conversation

@SawyerHood

Copy link
Copy Markdown
Collaborator

Human comments

What was wrong

bb passed OpenCode no permission policy, so OpenCode's own config decided. With the default config, OpenCode ran shell commands without asking even when the thread was in accept-edits, while Cursor asked for the same commands. Found while live-testing #5775.

What changed

  • The bridge launches OpenCode-dialect agents with OPENCODE_PERMISSION, which OpenCode merges over the permission keys of its config:
    • accept-edits: edit is allowed; bash, webfetch and external_directory ask. OpenCode's ACP permission requests become bb approvals.
    • full: all four are allowed.
  • A permission-mode change restarts the OpenCode session with the new policy, and OpenCode restores the conversation. Permission CLI flags already work this way for other agents.
  • Other dialects get no OpenCode policy.
  • dialectLaunchEnv now also holds the existing OPENCODE_CLIENT / OPENCODE_ENABLE_QUESTION_TOOL values.
  • The acp-provider skill documents the behaviour.

How you verified

  • New bridge tests:
    • an OpenCode session gets the full policy, then the accept-edits policy after a mode change, and the session is replaced with contextLost: false;
    • a generic ACP agent gets no policy.
  • pnpm exec turbo run test typecheck --filter=@bb/provider-bridge-acp: 524 passed, 4 skipped.
  • Live with opencode 1.18.35 in accept-edits:
    • a file write went through without asking;
    • touch oc-shell.flag waited as a pending bb approval and ran only after bb thread interactions approve;
    • after switching the thread to full, a shell command ran without asking.

AGENT GENERATED

bb passed OpenCode no permission policy, so OpenCode's own config decided:
with the default config it ran shell commands without asking even when the
thread was in accept-edits, while Cursor asked for the same commands.

The bridge now launches OpenCode-dialect agents with OPENCODE_PERMISSION,
which OpenCode merges over its config's permission keys:
- accept-edits: edits allowed; bash, webfetch and external_directory ask, and
  OpenCode's ACP permission requests become bb approvals.
- full: all four allowed.
A permission-mode change restarts the OpenCode session with the new policy
(OpenCode restores it), as permission CLI flags already do for other agents.
Other dialects get no OpenCode policy. Documented in the acp-provider skill.
@SawyerHood
SawyerHood added this pull request to stack #5818 October 20, 2026 00:50
@SawyerHood
SawyerHood merged commit 2f23958 into main Oct 20, 2026
47 checks passed
@SawyerHood
SawyerHood deleted the acp-fu-5-opencode-permissions branch October 20, 2026 15:37
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