You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
OpenCode hook misses .opencode project permissions and can lift deny or ask #4855
RTK 1.1.0 (tag v1.1.0, 753a3b0) and current develop (7e92da0; the file is byte-identical). OpenCode v2.0.26.
What happens.rtk hook opencode reads project permissions only from an ancestor directory's direct opencode.json/opencode.jsonc (src/hooks/permissions_opencode.rs, project_root_with_config / read_first_config). OpenCode v2 also discovers .opencode/opencode.json(c) (packages/core/src/config/discovery.ts). A project-level deny or ask placed there is invisible to the verdict comparison, so the hook rewrites and the native rule no longer matches the rewritten command.
Reproduction (disposable HOME, no config overrides):
In a project, .opencode/opencode.json: {"permissions":[{"action":"shell","resource":"git diff","effect":"deny"}]}
From the project: rtk hook opencode "git diff" → exit 0, {"command":"rtk git diff"} (deny lifted).
Move the same file to ./opencode.json and repeat → exit 0, {} (correct).
Confirmed end to end with the stock execute.before plugin on OpenCode 2.0.26: the raw git diff is denied by OpenCode, the rewritten rtk git diff runs and its output reaches the model. Replacing deny with ask silences the prompt the same way.
Expected.{} in both placements, since the rewrite changes the native verdict (the fail-closed rule from #4195 / #4187).
Proposed fix. Discover .opencode/ directories alongside direct files, preserving OpenCode's order (direct files outermost first, then project directories outermost first, opencode.json before opencode.jsonc per directory). PR follows; it is a focused discovery fix, not a claim of complete discovery parity (profile, agent-file and content sources still need their own qualification).
@superbiche · user · drafted with Claude Fable 5.1, reviewed before posting; the voice and decisions are mine.
Activity
rtk-wshm-sync-bot commentedon Oct 30, 2026
🔍 Automated Triage
bughighSummary
OpenCode hook doesn't discover
.opencode/opencode.json(c)project configs, letting a project-level deny/ask rule get silently lifted by the rewrite.📁 Relevant files
src/hooks/permissions_opencode.rsSuggested Actions
Triaged automatically by wshm · This is an automated analysis, not a human review.