Skip to content

Subagent can call plan_exit to escape plan mode #27886

Closed as not planned
Closed as not planned

Description

@BYK

Describe the bug

Subagents spawned via the task tool can call plan_exit to escape plan mode. The tools map passed to SessionPrompt.prompt() in task.ts does not include plan_exit: false, so the deny rules set via deriveSubagentSessionPermission() are silently overwritten when the prompt function rewrites session permissions from the tools map.

Steps to reproduce

  1. Enter plan mode
  2. Have the plan agent spawn a subagent via the task tool
  3. The subagent can call plan_exit and switch to build mode

Expected behavior

Subagents should not be able to call plan_exit. The tools map in the task tool should deny plan_exit for all subagent sessions.

System info

  • OpenCode version: v1.15.3
  • OS: Linux

Activity

  1. github-actions commented on Jul 16, 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