Commit ba94872
feat(agent): add plan mode, plan resumption, and context overflow fixes
## Plan Mode & Planning Workflow
- Add PlanMode state (Standard/Planning) with Shift+Tab toggle
- Add plan tools: plan_create, plan_next, plan_update, plan_list
- Add plan_menu.rs for interactive post-plan action selection
- Execute with auto-accept changes
- Execute with review for each change
- Modify plan with feedback
- Add plan resumption on startup - shows incomplete plans and suggests "continue"
- Add /plans command to list incomplete plans with progress info
- Update prompts with plan_execution_protocol explaining resumable plans
## Context Overflow Fix ("Input Too Long" Error)
- Fixed critical bug: was compacting empty conversation_history instead of raw_chat_history
- Add estimate_raw_history_tokens() to estimate tokens from rig::Message directly
- Truncate raw_chat_history directly when context too large (10→6→4 messages progressively)
- Add pre-request check to detect large context before hitting API limits
- Add find_most_recent_plan_file() for reliable plan path detection
## Auto-Accept Mode Improvements
- Show full code diff in auto-accept mode (same as confirmation prompts)
- Use render_diff() for existing files, render_new_file() for new files
- Apply to both WriteFileTool and WriteFilesTool
## Rate Limiting Mitigation
- Reduce extended thinking budget from 16000 to 8000 tokens
- Helps avoid API rate limits during heavy tool-use sessions
## New Modules
- src/agent/tools/plan.rs - Plan creation and execution tools
- src/agent/tools/truncation.rs - Output truncation utilities
- src/agent/tools/diagnostics.rs - Diagnostic tools
- src/agent/ui/plan_menu.rs - Plan action menu UI
## Vendor Changes
- Move rig-bedrock from patches/ to vendor/ directory
- Clean up obsolete patch files
## Prompts Updates
- Add is_plan_continuation_query() to detect "continue" requests
- Update plan_execution_protocol with resumption instructions
- Explain that plan_next automatically finds where you left off
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>1 parent 2c5b27e commit ba94872
58 files changed
Lines changed: 3474 additions & 3424 deletions
File tree
- patches/rig-bedrock
- src/agent
- ide
- prompts
- tools
- ui
- vendor/rig-bedrock
- examples
- common
- src
- types
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
76 | | - | |
| 76 | + | |
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
| |||
104 | 104 | | |
105 | 105 | | |
106 | 106 | | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
| 107 | + | |
This file was deleted.
This file was deleted.
0 commit comments