Skip to content

Sub-agent in plan mode bypasses restrictions after compaction #18213

Closed as not planned

Description

@8x34tnxge

Description

The Plan agent spawned a sub-agent to explore the project. A compaction happened during the exploration. Then, the sub-agent used cat and sed commands to modify the code. After the sub-agent had finished its work, the Plan agent told me, "You have completed all the tasks."

Plugins

No plugin installed

OpenCode version

1.2.27

Steps to reproduce

  1. I asked in Plan mode, "What is the best way to do it?"
  2. The agent in Plan mode spawned a sub-agent to explore the big picture of the project.
  3. The sub-agent only read the code.
  4. Compaction happened.
  5. The sub-agent used cat and sed commands to modify the code instead of just exploring.
  6. The agent in Plan mode told me, "All tasks had been completed before you asked."

Screenshot and/or share link

No response

Operating System

Arch Linux

Terminal

kitty

Activity

  1. added
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on Mar 19, 2026
  2. 8x34tnxge commented on Apr 15, 2026

    @8x34tnxge
    Author

    I don't know if it's fixed in the latest version 'cause I have disabled compaction. But the problem seems to be

    1. Plan agent spawns Explore sub-agent (no edit permission)
    2. Context compaction
    3. a General sub-agent (with edit permission) is spawned to continue previous task

    it looks like the General sub-agent is the default option for spawning a sub-agent?

  3. 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.

  4. removed
    bugSomething isn't working
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on May 3, 2026
  5. neuhaus commented on Jun 28, 2026

    @neuhaus

    Why isn‘t the default configuration getting fixed?

  6. neuhaus commented on Aug 4, 2026

    @neuhaus

    This issue remains open and critical.

  7. github-actions commented on Oct 4, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

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