Skip to content

feat(plugin): add permission review hooks - #45003

Merged
opencode-agent[bot] merged 4 commits into
v2from
plugin-permissions
Aug 25, 2026
Merged

opencode-agent[bot] merged 4 commits into
v2from
plugin-permissions

Conversation

@opencode-agent

@opencode-agent opencode-agent Bot commented Aug 25, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • add a native ctx.permission.hook("evaluate", ...) server-plugin hook for reviewing configured allow/ask decisions before execution or prompt publication
  • preserve explicit configured denies as final while allowing plugins to allow, deny, or escalate other decisions with an optional reason
  • expose stateless ctx.generate.text, read-only ctx.session.context, and permission list/get/reply methods to Promise and Effect plugins
  • remove the internal Permission.allowsAll() shell fast path so shell resources always pass through normal permission evaluation
  • keep reviewer execution cancellable while retaining uninterruptible pending-request bookkeeping
  • document the new plugin APIs and cover permission review behavior, prompt messages, cancellation, and deny precedence

Checks

  • bun typecheck (packages/core, packages/plugin, packages/client, packages/schema)
  • bun test test/permission.test.ts test/plugin-hooks.test.ts test/plugin.test.ts (packages/core)
  • bun test and bun run build (packages/plugin)
  • bun --bun run typecheck and bun --bun run check:generated (packages/www)
  • full website build pipeline with Node 22.12.0

Requested by: @R44VC0RP (vogel via Slack)

@opencode-agent
opencode-agent Bot merged commit 0fd7190 into v2 Aug 25, 2026
9 of 10 checks passed
@opencode-agent
opencode-agent Bot deleted the plugin-permissions branch August 25, 2026 16:57
jinhuang712 pushed a commit to jinhuang712/opencode that referenced this pull request Sep 26, 2026
Co-authored-by: R44VC0RP <[email protected]>
Co-authored-by: nexxeln <[email protected]>
Co-authored-by: thdxr <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants