Feature hasn't been suggested before.
Describe the enhancement you want to request
The permission.ask hook is declared in the Hooks interface (@opencode-ai/plugin) but never triggered from the permission engine. Plugins that implement permission.ask are silently ignored.
Wiring it would let plugins auto-allow or auto-deny permission requests before prompting the user — useful for governance sidecars, policy engines, and MCP integrations that manage permissions externally.
Proposed behavior:
- Built-in ruleset evaluation stays unchanged (deny short-circuits, allow passes).
- When rules evaluate to "ask", fire
Plugin.trigger("permission.ask", ...) after the request enters the pending queue.
- If the plugin sets
status:"allow" → resolve immediately, no prompt.
- If the plugin sets
status:"deny" → throw DeniedError, no prompt.
- If the plugin leaves
status:"ask" or throws → normal prompt flow.
Small change (~40 lines in permission/index.ts), zero regressions on existing tests.
Feature hasn't been suggested before.
Describe the enhancement you want to request
The
permission.askhook is declared in theHooksinterface (@opencode-ai/plugin) but never triggered from the permission engine. Plugins that implementpermission.askare silently ignored.Wiring it would let plugins auto-allow or auto-deny permission requests before prompting the user — useful for governance sidecars, policy engines, and MCP integrations that manage permissions externally.
Proposed behavior:
Plugin.trigger("permission.ask", ...)after the request enters the pending queue.status:"allow"→ resolve immediately, no prompt.status:"deny"→ throwDeniedError, no prompt.status:"ask"or throws → normal prompt flow.Small change (~40 lines in
permission/index.ts), zero regressions on existing tests.