fix(plugin): restore permission ask hook - #39442
Conversation
|
The following comment was made by an LLM, it may be inaccurate: Based on my search, I found several related PRs that are worth noting: Related PRs (Not Duplicates)
No duplicate PRs found |
|
We are very keen to see this PR land. This hook is the missing primitive for building genuinely useful permission-review plugins rather than either prompting for everything or blindly auto-approving everything. That feels especially timely now that OpenAI is pushing Luna more explicitly as a request-approval/review model: a cheaper second model reviews proposed actions, allows low-risk requests, and leaves higher-risk actions for the user. OpenCode cannot cleanly implement comparable features in plugins while The overall shape of this patch looks right to us: static We did notice two implementation details that seem worth tightening before merge:
Neither point changes our strong support for the PR or the API direction. We would really like this capability available: it is a small hook with disproportionately useful consequences for safer, lower-friction OpenCode workflows. |
Issue for this PR
Fixes #7006
Type of change
What does this PR do?
Restores the declared
permission.askplugin hook before OpenCode prompts the user. Plugins can allow or deny requests that static rules resolve toask; plugin failures fall back to the normal prompt.This rebases the approach from #30509 onto the current Effect/LayerNode service shape and credits @yohi's original implementation. The hook receives the current v2
PermissionRequesttype and a copy of mutable request data.How did you verify your code works?
Checklist