opencode icon indicating copy to clipboard operation
opencode copied to clipboard

feat: implement exitplanmode tool for plan mode workflow

Open sandys opened this issue 3 weeks ago • 0 comments

Previously, plan mode prompts referenced an ExitPlanMode tool that didn't exist, causing the AI to get stuck in loops when trying to exit planning.

Changes:

  • Add exitplanmode tool that accepts a plan parameter and signals transition out of planning phase
  • Register tool in registry, filtered to only be available in plan mode
  • Simplify plan mode prompts to clearly explain the workflow
  • Add guidance for interpreting future-tense user instructions (e.g., "remember to add tests") as plan items, not immediate actions

This fixes the issue where users saying things like "make sure you write a markdown before starting" would cause the AI to loop indefinitely, unable to reconcile the instruction with plan mode constraints.

sandys avatar Dec 28 '25 20:12 sandys