Skip to content

Plan Mode Agent Spawned General Subagent to edit code #24741

Closed as not planned
Closed as not planned

Description

@DUCKJAIII

Question

I was on Open Code GUI on Windows.

I was in plan mode, but the main agent was able to spawn General Agent to make code edits.

Is this a bug, or a feature?

Activity

  1. added
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on Apr 28, 2026
  2. github-actions commented on Apr 28, 2026

    @github-actions
    Contributor

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

  3. DUCKJAIII commented on Apr 28, 2026

    @DUCKJAIII
    Author

    Bot is right, a duplicated issue

  4. nikitakot commented on Apr 29, 2026

    @nikitakot

    @DUCKJAIII you can solve it by setting the permissions properly

    {
      "$schema": "https://opencode.ai/config.json",
      // set readonly global permissions, it will override default permissions for all agents, including the built-in agents (build, general, explore...)
      "permission": {
        "edit": "ask",
        "task": {
          // do not allow running subagents with edit permissions by default without user confirmation
          "*": "ask",
          "explore": "allow",
        },
      },
      "agent": {
        // allow edit permissions for specific agents
        "build": {
          "permission": {
            "edit": {
              "*": "allow",
            },
            "task": {
              // allow agents with edit permission to run subagents with edit permissions by default without user confirmation
              "general": "allow",
            },
          },
        },
        "general": {
          "permission": {
            "edit": {
              "*": "allow",
            },
            "task": {
              "general": "allow",
            },
          },
        },
      },
    }
  5. neuhaus commented on May 1, 2026

    @neuhaus

    Is this a bug, or a feature?

    it's a critical bug since Jan 1st 2026.

  6. neuhaus commented on May 1, 2026

    @neuhaus

    @DUCKJAIII you can solve it by setting the permissions properly

    Does this fix bash access (including destructive commands) in plan mode? I'm not so sure it does.

  7. nikitakot commented on May 1, 2026

    @nikitakot

    @DUCKJAIII you can solve it by setting the permissions properly

    Does this fix bash access (including destructive commands) in plan mode? I'm not so sure it does.

    works on my end, it seems like once you set the global permissions they override all agents permissions, do you have any global bash permissions set?

  8. DUCKJAIII commented on May 1, 2026

    @DUCKJAIII
    Author

    @DUCKJAIII you can solve it by setting the permissions properly

    Does this fix bash access (including destructive commands) in plan mode? I'm not so sure it does.

    Sorry to tell you that I have not implemented the recommended fix

    My initial work around was to tell the agent to not spawn subagents with edit/destructive commands in plan mode via agents.md

    The workaround was not ideal, but worked for me. I am using Gemini 3.1 pro custom tools

    I will come back once I have tested the suggested fix and removing the instruction in agents.md

    Alternatively, let me know your experience

  9. neuhaus commented on May 1, 2026

    @neuhaus

    @DUCKJAIII you can solve it by setting the permissions properly

    Does this fix bash access (including destructive commands) in plan mode? I'm not so sure it does.

    works on my end, it seems like once you set the global permissions they override all agents permissions, do you have any global bash permissions set?

    I haven't changed any permissions yet.

  10. neuhaus commented on May 1, 2026

    @neuhaus

    This critical issue is a duplicate of issue #7292 and hasn't been fixed since it was introduced on Jan 1st.

  11. removed
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on May 3, 2026
  12. rekram1-node commented on Jun 23, 2026

    @rekram1-node
    Contributor

    Automated: closing question issues.

    GitHub Issues are for bug reports and feature requests only — questions / support are no longer tracked here.

    If this is a bug or feature request, please open a new issue with the appropriate template.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions