feat: Add predefined suggestions after finishing the planning session#459
feat: Add predefined suggestions after finishing the planning session#459alex-alecu wants to merge 11 commits intodevfrom
Conversation
… to improve context management
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Code Review SummaryStatus: No Issues Found | Recommendation: Merge The PR introduces a plan follow-up feature that prompts users after the plan agent completes, offering options to start a new session, continue in the current session, or provide custom follow-up text. The implementation is clean and well-structured:
All existing review comments have been addressed by the author. Files Reviewed (3 files)
|
…ummary of what was explored and which files were read so the AI doesn't have to re-search the codebase.
| const sections = [] as string[] | ||
| if (tasks.length) { | ||
| sections.push("### Explored\n\n" + tasks.join("\n\n")) | ||
| } | ||
| if (files.length) { | ||
| sections.push("### Files read\n\n" + files.join("\n")) | ||
| } | ||
|
|
||
| const full = "\n\n## Context from planning research\n\n" + sections.join("\n\n") |
There was a problem hiding this comment.
Not really sure what this is doing? Is this user output we need to later localize?
There was a problem hiding this comment.
If we start a new session just with the plan, the coding agent will do some research first to make sure it understands the plan.
By providing a small amount of research context from the planning agent we reduce drastically the research the new coding agent needs to make.
There was a problem hiding this comment.
What if the beginning of the research for the plan wasn't valuable? What CC actually does instead they reference the most important files that are relevant on compaction instead. I would question if the first 10k characters have always high entropy.
Context
Following the example from Claude Code after a planning session:
The context management is the most important job of tools using AI models. By starting a fresh session with just the plan as the first message, we maximize the efficiency of the implementation.
It's also cheaper to start with a fresh context - the CLI will not send on every request all the context it took build the plan.
Implementation
Added plan follow-up flow in plan-followup.ts (line 25).
Added plan follow-up flow in
/Users/alex/Documents/code/kilo-code/kilo/packages/opencode/src/kilocode/plan-followup.ts:25.Ready to implement?Start new session,Continue here, and custom textTuiEvent.SessionSelectand starts the new session loop for the new-session pathWired it into the existing loop break point in
/Users/alex/Documents/code/kilo-code/kilo/packages/opencode/src/session/prompt.ts:335withkilocode_changemarkers.PlanFollowup.ask(...)continuere-enters the loop when needed; otherwise it exits as beforeAdded tests in
/Users/alex/Documents/code/kilo-code/kilo/packages/opencode/test/kilocode/plan-followup.test.ts:95.Screenshots
How to Test
Start a planning session and look for the suggestions at the end.
Get in Touch
We'd love to have a way to chat with you about your changes if necessary. If you're in the Kilo Code Discord, please share your handle here.