Skip to content

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

Closed as not planned

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

Activity

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

    @github-actions
    Contributor

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

  3. BYK commented on Mar 21, 2026

    @BYK
    ContributorAuthor

    Good catch — point 3 (question text rendered as plain text instead of markdown) overlaps with #12781.

    Our PR #18516 fixes this for the web UI by using the Markdown component in both the live question dock (session-question-dock.tsx) and historical question display (message-part.tsx). The TUI side (#12781 also mentions terminal rendering) is not addressed here.

    Points 1 and 2 (subagent plan escape + plan content not shown in exit prompt) are unique to this issue.

  4. removed
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on May 3, 2026
  5. github-actions commented on Jul 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