FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

fix: propagate parent agent permissions to subagent child sessions by brittlewis12 · Pull Request #12584 · anomalyco/opencode · GitHub

fix: propagate parent agent permissions to subagent child sessions - #12584

Closed
brittlewis12 wants to merge 1 commit into
anomalyco:devfrom
brittlewis12:fix/subagent-permission-propagation
Closed

fix: propagate parent agent permissions to subagent child sessions#12584
brittlewis12 wants to merge 1 commit into
anomalyco:devfrom
brittlewis12:fix/subagent-permission-propagation

Conversation

Copy link
Copy Markdown
Contributor

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.

When a primary agent with permissive rules (e.g. permission: 'allow')
spawns a subagent via TaskTool, the parent agent's permission rules were
not included in the child session's permission field. This caused
subagents to use only their own restrictive defaults, meaning any tool
call evaluating to 'ask' would block indefinitely in unattended mode.

The fix resolves the calling agent and includes its permission rules in
the child session, positioned before the hard-coded denies (todowrite,
todoread, task) so findLast respects the override order correctly.

github-actions Bot commented Feb 7, 2026

Copy link
Copy Markdown
Contributor

The following comment was made by an LLM, it may be inaccurate:

Based on my search, I found several related PRs that address subagent permission issues. Here are the potentially relevant ones (excluding the current PR #12584):

Related PRs:

  1. fix: prevent subagent permission bypass via tools field inheritance #7473 - fix: prevent subagent permission bypass via tools field inheritance

    • Directly related to subagent permission handling and preventing permission bypasses
  2. feat(task): Add subagent-to-subagent delegation with budgets, persistent sessions, and hierarchical session navigation #7756 - feat(task): Add subagent-to-subagent delegation with budgets, persistent sessions, and hierarchical session navigation

    • Addresses subagent-to-subagent delegation and session management, which relates to the permission inheritance chain
  3. fix(acp): handle permission requests from child sessions #12136 - fix(acp): handle permission requests from child sessions

    • Directly handles permissions for child sessions, potentially overlapping with the current fix
  4. fix(questions): fixes #7654 where sub-sub agents can't ask questions #10539 - fix(questions): fixes #7654 where sub-sub agents can't ask questions

    • Addresses permission/capability issues in nested subagent scenarios

Important: Check if #12136 (handle permission requests from child sessions) might be addressing the same underlying issue as #12584, as both deal with child session permissions.

github-actions Bot commented Apr 9, 2026

Copy link
Copy Markdown
Contributor

Closing this pull request because it has had no updates for more than 60 days. If you plan to continue working on it, feel free to reopen or open a new PR.

github-actions Bot closed this Apr 9, 2026
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Subagents don’t respect "*": "allow" agent permissions

1 participant


Back | FazBrowse Home | New Git URL