When in planning mode and a plan is approved, the AI would try to use implementation tools (write, edit, bash) but they weren't available because tools are determined at the start of each response based on the session mode.
Instead of restricting tools by mode, we now:
- Always provide all tools regardless of mode
- Rely on system prompts to guide the AI on which tools to use in each mode
- Include PlanApprovedTool in the main TOOLS array so it's always available
- Removed separate
PLANNING_MODE_TOOLSandREVIEW_MODE_TOOLSarrays - Always use the full
TOOLSarray for all modes - Added
PlanApprovedToolto the mainTOOLSarray - For review mode, append
ReviewToolto the base tools
- Removed the warning about tool availability
- AI can now immediately start implementing after plan approval
- Updated to reflect that tools are immediately available after approval
- No need to wait for another user message
- Better UX: Users don't need to send an extra "go ahead" message after approving a plan
- Simpler code: No complex tool filtering based on mode
- More reliable: AI can always access the tools it needs
- Mode enforcement: Still maintained through system prompts rather than tool availability
- User approves plan: "yes, looks good"
- AI uses PlanApprovedTool to switch to normal mode
- AI immediately starts implementing using write/edit/bash tools
- No additional user interaction needed
The AI respects mode restrictions through the system prompts, which clearly state what tools should/shouldn't be used in each mode.