[PR #12584] fix: propagate parent agent permissions to subagent child sessions #14283

Open
opened 2026-02-16 18:19:05 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/12584

State: open
Merged: No


Fixes #12566

What does this PR do?

Subagents don’t respect the parent agent's permission rules, instead using their own restrictive defaults. Any tool call evaluating to 'ask' would block indefinitely, even when explicitly configured to run unattended.

This fix includes the parent agent’s permission rules in the child session, before the hard-coded denies (todowrite, todoread, task) so findLast respects the override order correctly.

How did you verify your code works?

wrote a regression test, saw it fail, and then made it pass.

**Original Pull Request:** https://github.com/anomalyco/opencode/pull/12584 **State:** open **Merged:** No --- Fixes #12566 ### What does this PR do? Subagents don’t respect the parent agent's permission rules, instead using their own restrictive defaults. Any tool call evaluating to 'ask' would block indefinitely, even when explicitly configured to run unattended. This fix includes the parent agent’s permission rules in the child session, before the hard-coded denies (todowrite, todoread, task) so findLast respects the override order correctly. ### How did you verify your code works? wrote a regression test, saw it fail, and then made it pass.
yindo added the pull-request label 2026-02-16 18:19:05 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#14283