Skip to content

refactor: Improve plan mode with explicit approval request#296

Merged
edenreich merged 8 commits intomainfrom
refactor/plan-mode-improvements
Dec 2, 2025
Merged

refactor: Improve plan mode with explicit approval request#296
edenreich merged 8 commits intomainfrom
refactor/plan-mode-improvements

Conversation

@edenreich
Copy link
Contributor

Summary

This PR refactors the planning system to replace automatic plan approval with an agent-controlled explicit approval mechanism.

Changes

Core Changes:

  1. Added RequestPlanApproval tool - New tool that allows agents to explicitly submit plans for approval
  2. Removed automatic plan approval trigger - Plans are now only submitted when the agent explicitly requests approval
  3. Enhanced plan mode capabilities - Added TodoWrite and RequestPlanApproval tools to plan mode
  4. Updated system prompts - More actionable planning prompts that guide agents to use the new approval mechanism
  5. Removed dedicated plan approval UI component - Integrated approval into the existing conversation flow
  6. Improved autocomplete filtering - Better tool filtering based on agent mode (plan vs execution)

Technical Details:

  • New file: internal/services/tools/request_plan_approval.go - Implements the RequestPlanApproval tool
  • Deleted file: internal/ui/components/plan_approval_component.go - Dedicated UI component no longer needed
  • Modified files: 15 files with improvements to agent services, conversation handling, and UI components

Benefits:

  • More control: Agents decide when to request plan approval
  • Better UX: Integrated approval flow reduces context switching
  • Flexibility: Agents can create and refine plans before requesting approval
  • Cleaner code: Removes complex automatic triggering logic

Testing

  • All existing tests pass
  • Manual testing of plan creation and approval flow
  • Verified TodoWrite integration in plan mode

Migration Notes

No breaking changes - existing workflows continue to work with improved UX.

- Add RequestPlanApproval tool for explicit plan submission
- Remove automatic plan approval trigger - now agent-controlled
- Enhance plan mode capabilities with TodoWrite and RequestPlanApproval tools
- Update system prompts for more actionable planning
- Remove dedicated plan approval UI component
- Improve autocomplete filtering based on agent mode
- Various bug fixes and UI improvements
Signed-off-by: Eden Reich <eden.reich@gmail.com>
Signed-off-by: Eden Reich <eden.reich@gmail.com>
Signed-off-by: Eden Reich <eden.reich@gmail.com>
@edenreich
Copy link
Contributor Author

PR Description Update Summary:

Based on comprehensive code analysis, this PR includes more extensive changes than initially documented:

Comprehensive Changes Identified:

Major Improvements:

  1. Inline Plan Approval - Replaced modal with colored inline buttons (Accept/Reject/Auto-Approve)
  2. New InputStatusBar Component - Shows model, theme, agents, context usage, and mode indicators
  3. Enhanced State Management - Added PlanApprovalUIState and PlanApprovalAction enum
  4. Simplified InputView - Removed text selection mode, consolidated UI logic
  5. Improved Event System - Added plan approval events and better integration

File Changes Summary:

  • 34 files total (not 15 as initially documented)
  • 1853 insertions, 1889 deletions
  • Added 2 new files, removed 3 files
  • 29 files modified with architectural improvements

Key Benefits:

  • Better UX with inline approval workflow
  • Enhanced visibility with status information
  • Cleaner architecture with removed duplicate components
  • Comprehensive keyboard navigation for plan approval

The PR description should be updated to reflect these comprehensive improvements.

@edenreich edenreich merged commit 3aaedc4 into main Dec 2, 2025
5 checks passed
@edenreich edenreich deleted the refactor/plan-mode-improvements branch December 2, 2025 00:07
ig-semantic-release-bot bot pushed a commit that referenced this pull request Dec 2, 2025
## [0.76.2](v0.76.1...v0.76.2) (2025-12-02)

### ♻️ Code Refactoring

* Improve plan mode with explicit approval request ([#296](#296)) ([3aaedc4](3aaedc4))
@ig-semantic-release-bot
Copy link

🎉 This PR is included in version 0.76.2 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments