Repository navigation
fix(acp): enforce bb permission modes for OpenCode - #5816
Merged
Merged
Conversation
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.
2 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
OPENCODE_PERMISSION, which OpenCode merges over thepermissionkeys of its config:accept-edits:editis allowed;bash,webfetchandexternal_directoryask. OpenCode's ACP permission requests become bb approvals.full: all four are allowed.dialectLaunchEnvnow also holds the existingOPENCODE_CLIENT/OPENCODE_ENABLE_QUESTION_TOOLvalues.How you verified
fullpolicy, then theaccept-editspolicy after a mode change, and the session is replaced withcontextLost: false;pnpm exec turbo run test typecheck --filter=@bb/provider-bridge-acp: 524 passed, 4 skipped.accept-edits:touch oc-shell.flagwaited as a pending bb approval and ran only afterbb thread interactions approve;full, a shell command ran without asking.