GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||
GeezerVison is showing github.com — feat(permission): restore permission ask hook safely by kernel-oops · Pull Request #42633 · anomalyco/opencode Conversation
|
|
The following comment was made by an LLM, it may be inaccurate: Based on the search results, I found related PRs, but none that appear to be duplicates of PR #42633: Related PRs (not duplicates):
No duplicate PRs found |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Thanks for updating your PR! It now meets our contributing guidelines. 👍 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Scope: restores the
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
run-mode platform ✅I maintain a downstream plugin whose entire contract is the permission.ask hook, so I built and verified this PR against a purpose-built probe + acceptance matrix (isolated temp projects, provider-only config in memory, opencode run with permission.bash: {"*": "ask"}).
Build & tests (head dd25dface, bun 1.3.14, linux-x64):
bun test test/permission/ test/plugin/trigger.test.ts → 94 pass / 0 fail (the PR's new allow/deny/failure-fallback/interruption/structuredClone-isolation/multi-plugin-override tests included). Worth noting: PR CI currently only runs the bot checks — the test suite never ran here, so I ran it locally.tsgo --noEmit → clean. Full bun run script/build.ts → standalone binaries compile.Permission.node → Plugin.node dep: the compiled binary boots and completes real sessions normally.Behavior on a real compiled binary:
permission.ask never fires, run auto-rejects (PROBE FAIL, exit 1) — repro of #7006.Event.Asked path, i.e. before run-mode auto-rejection. A plugin that sets output.status = "allow" genuinely suppresses the prompt and the command executes; "deny" produces DeniedError; a throwing plugin falls back to the normal prompt. main (df6aecd) still has zero trigger call sites, so this PR is exactly the missing piece.One ecosystem heads-up (no code change requested): this PR re-types the hook input from the v1 Permission to v2 PermissionRequest — i.e. type → permission, singular pattern → patterns[]. Existing plugins written against the shipped type declaration will read input.type === undefined and silently become no-ops on builds with this fix (I hit exactly that in my own plugin, since the hook never fired anywhere the field mismatch stayed invisible). If the changelog/release notes call out the field rename, it would save other plugin authors a confusing debugging session.
Thanks @kernel-oops for sticking with this (and for the interruption-propagation handling, which the earlier attempts got wrong). From the downstream-plugin side: this fixes us. Happy to re-test on request or when it moves.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Thank you — this is exceptionally useful validation, especially the real |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
dd25dfa to
b4dfbdc
Compare
|
Automated PR Cleanup Thank you for contributing to opencode. Due to the high volume of PRs from users and AI agents, we periodically close older PRs using automated criteria so maintainers can focus review time on the most active and community-supported contributions. This PR was closed because it matched the following cleanup criteria:
PRs created within the last month are not affected by this cleanup. If you believe this PR was closed incorrectly, or if you are still actively working on it, please leave a comment explaining why it should be reopened. A maintainer can review and reopen it if appropriate. Thanks again for taking the time to contribute. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
permission.ask plugin hook is defined but not triggered
There was an error while loading. Please reload this page.