opencode
opencode copied to clipboard
feat: implement exitplanmode tool for plan mode workflow
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.