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: subagents launched from T3 Code ignore agent permissions #38100
Subagents launched from an OpenCode session running inside T3 Code ignore their agent permissions. A custom agent with edit: deny, and even the built-in explore agent, can call write and create files. The same agents launched with opencode run --standalone enforce their permissions correctly.
Environment
opencode version: 2.3.0
OS: Linux 7.0.0-1017-aws x86_64
Terminal: Unavailable: running under T3 Code, no terminal env vars
Shell: /bin/bash
Install/channel: latest
Active plugins: opencode-ponytail
Reproduction
Create ~/.config/opencode/agents/review.md:
---description: Reviews changesmode: subagentmodel: github-copilot/claude-sonnet-5.5#mediumpermissions:
- action: editresource: "*"effect: deny---
Review the current changes.
In a T3 Code thread using the OpenCode harness (tested in both full-access and approval-required runtime modes), ask the main agent to launch the review subagent (or the built-in explore subagent) and have it create a file with the write tool.
Run the same agent with opencode run --standalone --auto --agent review "create ./t.txt with the write tool".
Expected Behavior
The subagent has no write tool, or the call is denied. This is what happens in step 3: review reports no write tool, and a touch through shell returns permission.rejected.
Actual Behavior
In step 2 the subagent has a write tool and the call succeeds with "Created file successfully". The built-in explore, which denies everything except reads, search, web, and shell, also gets write. The agent's model setting is still applied (Haiku or Sonnet as configured), so the agent file is loaded. Only permissions are dropped.
Additional Context
Reproduced consistently: 3 of 3 attempts in a full-access thread, plus a write tool still present in an approval-required thread.
The server log has no permission entries for these subagent sessions.
It is unclear whether this is in T3 Code's OpenCode integration or in OpenCode's handling of permissions for child sessions started by an external client.
Activity
XScythe commentedon Nov 17, 2026
Possibly related: #11458 (OpenCode Auto mode ignores user permission patterns).
test(server): OpenCode subagents keep their own agent denies (#38100)
fix(opencode): root sessions carry no allow rule for a subagent to in…
fix(opencode): a subagent session is written none of its agent's denies
fix(opencode): answer permission requests only for live runs, and del…
fix(opencode): leave provider-raised permission requests to the user
fix(opencode): decide permission requests under both path matchings f…
fix(opencode): declare the agent rules cache before the event stream …