Skip to content

Planning mode: subagents can trigger plan_exit, plan not shown before build switch, question text renders as plain text #18515

@BYK

Description

@BYK

Description

Three issues with the experimental planning mode:

  1. Subagents can escape plan mode: When the plan agent spawns subagents (explore/general), those child sessions have access to plan_exit, allowing them to accidentally trigger a switch to build mode. A user could then accidentally confirm, putting the session into build mode prematurely.

  2. Plan not shown before asking to proceed: When plan_exit is called, the question just says "Plan at X is complete. Would you like to switch?" but doesn't show the plan content. The user must blindly decide whether to approve.

  3. Question text renders as plain text: The question dock renders question.question as raw text, not markdown. Even if the plan content were included, it would display unformatted — no headers, lists, code blocks, etc.

Steps to reproduce

  1. Enable experimental plan mode (OPENCODE_EXPERIMENTAL_PLAN_MODE=1)
  2. Start a planning session — the plan agent spawns explore subagents
  3. Observe that subagents can call plan_exit and offer to switch to build mode
  4. When the plan agent completes and calls plan_exit, the question dock shows a generic message without the plan content
  5. Any markdown in question text (headers, code, lists) appears as raw plain text

OpenCode version

Latest dev

Operating System

Linux

Metadata

Metadata

Assignees

Labels

coreAnything pertaining to core functionality of the application (opencode server stuff)

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions