Repository navigation
feat(opencode): model-gated approver plugin (permission reviewer) - #243
Merged
st0nefish-ci[bot] merged 1 commit intoNov 12, 2026
Merged
Conversation
A permission reviewer for OpenCode V2 built on
ctx.permission.hook("evaluate"). A static allow/ask pre-filter handles
routine calls; the rest are judged by a cheap model using a layered policy
prompt and the latest user message, and either pass or escalate to a human.
- plugins-opencode/approver: pure core (options, prompt layering, multi-
resource pre-filter, decide, audit entry) + hook.ts as the only file that
touches the permission hook
- configurable model/tier, threshold, onError, timeoutMs, shadow mode,
JSONL audit log, subagent escalation, headless handling
- judge input JSON-quotes resources and labels them untrusted; one deadline
covers the whole judged path; subagent lookup failure fails closed
- 28 unit tests; register the plugin in the opencode validator and README
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
st0nefish-ci
Bot
deleted the
worktree-enhancement-opencode-approver-plugin
branch
November 12, 2026 20:35
3 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.
Summary
New OpenCode plugin
plugins-opencode/approver/: a model-gated permission reviewer built onctx.permission.hook("evaluate").allow/askpre-filter handles routine calls with no model call. It handles several resources per shell action: anyaskmatch escalates, andallowneeds every resource to match.ctx.experimental.generate.decisions) given a layered policy prompt (project.opencode/approver.md>options.prompt> user file > built-in) and the latest user message, bounded.modelTiersconvention assession), probability threshold,onError,timeoutMs, shadow mode, JSONL audit log, subagent escalation and aheadlessoption.src/hook.ts, so moving toexperimental.reviewis a single-file change.plugins-opencode/README.md.Review fixes after two review passes:
headless: allownever loosens a configured ask.sourcelabels (rule-deny,rule-ask).Test plan
bash tests/opencode/test-approver-core.sh(28 tests)bash .github/scripts/validate-all.sh(all 7 checks; local rumdl 0.2.78 vs CI pin 0.2.69)@opencode/plugin/@opencode/client2.2.7 types only. Suggest running withshadow: truefirst.Caveats
.opencode/approver.mdoverrides the user-level prompt, as the issue specifies, so an untrusted checkout can ship a permissive policy.headlessis an explicit option defaulting toprompt; the event exposes no signal to detect an unattended session.onError: allow, a hung session lookup lets a subagent action through (opt-in setting only).askMessage.Closes #241
🤖 Generated with Claude Code