Skip to content

Latest commit

 

History

History
48 lines (31 loc) · 1.74 KB

File metadata and controls

48 lines (31 loc) · 1.74 KB

Fix: Plan Approval Tool Availability

Problem

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.

Solution

Instead of restricting tools by mode, we now:

  1. Always provide all tools regardless of mode
  2. Rely on system prompts to guide the AI on which tools to use in each mode
  3. Include PlanApprovedTool in the main TOOLS array so it's always available

Changes Made

1. Provider.ts

  • Removed separate PLANNING_MODE_TOOLS and REVIEW_MODE_TOOLS arrays
  • Always use the full TOOLS array for all modes
  • Added PlanApprovedTool to the main TOOLS array
  • For review mode, append ReviewTool to the base tools

2. PlanApprovedTool.ts

  • Removed the warning about tool availability
  • AI can now immediately start implementing after plan approval

3. Planning Prompt

  • Updated to reflect that tools are immediately available after approval
  • No need to wait for another user message

Benefits

  • 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

How It Works Now

  1. User approves plan: "yes, looks good"
  2. AI uses PlanApprovedTool to switch to normal mode
  3. AI immediately starts implementing using write/edit/bash tools
  4. 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.