Opencode running in plan mode called a subagent to bypass edit permission #6456

Open
opened 2026-02-16 18:04:17 -05:00 by yindo · 1 comment
Owner

Originally created by @FOV0813 on GitHub (Jan 16, 2026).

Originally assigned to: @rekram1-node on GitHub.

Question

I was working at plan mode and ask for refactor plan and opencode started to write the code by calling a subagent. Is that a bug or just my misconfiguration?

Image

As the picture shows, after the agent tried to edit the file for several times it started to call subagents and successfully edited my file.

Originally created by @FOV0813 on GitHub (Jan 16, 2026). Originally assigned to: @rekram1-node on GitHub. ### Question I was working at plan mode and ask for refactor plan and opencode started to write the code by calling a subagent. Is that a bug or just my misconfiguration? <img width="1524" height="467" alt="Image" src="https://github.com/user-attachments/assets/585fa627-a260-497d-aefb-849056484ac8" /> As the picture shows, after the agent tried to edit the file for several times it started to call subagents and successfully edited my file.
Author
Owner

@github-actions[bot] commented on GitHub (Jan 16, 2026):

This issue might be a duplicate of existing issues. Please check:

  • #6527: [Security Issue/Bug] Plan mode restrictions bypassed when spawning sub-agents - This is the most direct match with detailed documentation of the same vulnerability
  • #4267: Restrict which subagents a custom agent can spawn (built-in Plan mode can write files via sub agent) - Previously identified and closed as the same issue
  • #7474: Subagent permissions not enforced - configured restrictions ignored - Shows the root cause of subagents bypassing parent permissions
  • #7292: Plan mode is editing my files - Plan mode making file modifications when it shouldn't
  • #5475: Files were modified even being under 'Plan Mode' - Similar plan mode file editing issue
  • #2709: Plan Agent does modifications to files - Plan agent making modifications despite restrictions
  • #3038: The model loops attempting to edit files in PLAN mode - Model repeatedly trying to edit in plan mode

Feel free to ignore if none of these address your specific case.

@github-actions[bot] commented on GitHub (Jan 16, 2026): This issue might be a duplicate of existing issues. Please check: - #6527: [Security Issue/Bug] Plan mode restrictions bypassed when spawning sub-agents - This is the most direct match with detailed documentation of the same vulnerability - #4267: Restrict which subagents a custom agent can spawn (built-in Plan mode can write files via sub agent) - Previously identified and closed as the same issue - #7474: Subagent permissions not enforced - configured restrictions ignored - Shows the root cause of subagents bypassing parent permissions - #7292: Plan mode is editing my files - Plan mode making file modifications when it shouldn't - #5475: Files were modified even being under 'Plan Mode' - Similar plan mode file editing issue - #2709: Plan Agent does modifications to files - Plan agent making modifications despite restrictions - #3038: The model loops attempting to edit files in PLAN mode - Model repeatedly trying to edit in plan mode Feel free to ignore if none of these address your specific case.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#6456