Repository navigation
Description
Summary
A denied tool permission in a V2 child session is reported as an explicit user interruption. This makes foreground subagent calls fail with Session interrupted by user even though the user never interrupted them.
Environment
- opencode version:
0.0.0-next-15088 - OS: macOS 25.5.0, arm64
- Terminal: Zed (
TERM=xterm-256color,COLORTERM=truecolor) - Shell:
/bin/zsh - Install/channel: next
- Active plugins:
share-with-team.ts,debug-workspace-plugin.ts,@warp-dot-dev/opencode-warp
Reproduction
- Start a foreground Explore subagent from a V2 parent session.
- Give it a task that causes it to attempt the
shelltool. - Let the configured permissions reject
shellfor the Explore agent. - Inspect the child and parent durable events.
Observed consistently in two Explore children from parent session ses_0c0dc18b9ffeQwp2hcCZa4EK7d:
ses_0c0cdb674ffeFsJ169taUaOwlxses_0c0cc2818ffe54Orj8DX2LSK4v
Expected Behavior
A denied tool permission should remain a permission rejection. The child execution should fail or settle with a permission-specific outcome, and the parent subagent tool should report that the child could not use shell.
session.execution.interrupted { reason: "user" } should only be emitted for an actual explicit user interruption.
Actual Behavior
The child first records the correct tool and step failure:
session.tool.failed
error.type = "permission.rejected"
error.message = "Permission denied: shell"
session.step.failed
error.type = "permission.rejected"
error.message = "Permission denied: shell"
It then records an incorrect terminal event:
session.execution.interrupted
reason = "user"
The foreground parent subagent tool consequently reports:
Session interrupted by user
No user interrupt request occurred.
Additional Context
The runner converts permission-rejected tool settlement into UserInterruptedError, and SessionExecutionLocal.terminal(...) maps that error to session.execution.interrupted { reason: "user" }. This conflates two separate facts:
- the user or policy denied a particular tool action
- the user explicitly interrupted Session execution
General review subagents in the same parent session completed normally because they did not hit the denied Explore shell permission path.
This is particularly confusing for foreground subagents because the parent loses the actionable permission error and instead receives a false attribution to the user.
Activity
opencode-agent commentedon Jul 9, 2026
Additional report from Aiden on 2026-07-09:
PermissionV2.DeclinedErroris still surfacing assession.execution.interrupted, so a denied shell permission can look like the execution succeeded or was merely user-interrupted. That is especially confusing/scary for shell calls, where users need a denial to be reported unambiguously as a permission rejection.opencode-agent commentedon Jul 10, 2026
Audit: this appears fixed by #36155 (), with related groundwork in #36067. #36155 removes the permission-rejected → user-interrupted behavior and adds coverage for returning configured permission denials to the model. Closing as completed; reopen if a fresh repro still reports permission denial as user interruption.
opencode-agent commentedon Jul 10, 2026
Correction to audit note above: this appears fixed by PR #36155 (
fix(core): continue after configured permission denial), with related groundwork in PR #36067. PR #36155 removes the permission-rejected to user-interrupted behavior and adds coverage for returning configured permission denials to the model. Closed as completed; reopen if a fresh repro still reports permission denial as user interruption.