Skip to content

fix(plan): prevent repeated "Ready to implement?" prompt in plan mode#6218

Closed
shssoichiro wants to merge 1 commit intoKilo-Org:mainfrom
shssoichiro:fix/plan-mode-repeated-implement-prompt
Closed

fix(plan): prevent repeated "Ready to implement?" prompt in plan mode#6218
shssoichiro wants to merge 1 commit intoKilo-Org:mainfrom
shssoichiro:fix/plan-mode-repeated-implement-prompt

Conversation

@shssoichiro
Copy link
Contributor

Context

Fixes #6143

Implementation

Skip the plan followup prompt when the last user message is synthetic (programmatically injected), breaking the cycle where custom text input triggers agent response → prompt → custom text → agent response → prompt indefinitely. Real user messages still trigger the followup as expected.

Screenshots

The Plan agent now properly finishes the plan before requesting to implement.

image image

How to Test

  • Enter Plan mode and begin developing a plan interactively
  • Provide responses to questions from the agent
  • Expect to see a proper workflow, and see a plan presented before being asked to implement

I only tested in a limited capacity, so a maintainer may want to perform more thorough real-world verification.

Get in Touch

ExpedientFalcon on Discord

Skip the plan followup prompt when the last user message is synthetic
(programmatically injected), breaking the cycle where custom text input
triggers agent response → prompt → custom text → agent response → prompt
indefinitely. Real user messages still trigger the followup as expected.

Fixes Kilo-Org#6143
@github-actions
Copy link
Contributor

The following comment was made by an LLM, it may be inaccurate:

@kilo-code-bot
Copy link
Contributor

kilo-code-bot bot commented Feb 24, 2026

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Clean, well-scoped fix that prevents the repeated "Ready to implement?" prompt cycle in plan mode. The approach of detecting synthetic messages via lastUserParts and skipping the followup prompt is sound and follows the existing pattern used elsewhere in the codebase (e.g., the ensureTitle function at lines 1950-1956). The optional chaining and nullish coalescing on lastUserParts correctly handles the undefined case, and the texts.length > 0 guard properly handles messages with no text parts.

Files Reviewed (1 file)
  • packages/opencode/src/session/prompt.ts - 0 issues

@alex-alecu
Copy link
Contributor

@shssoichiro Thank you for your input! This PR is a quick fix and not the proper solution: kilo should suggest "Ready to implement?" only when it's sure it has all the information necessary to implement the plan. I will follow up with the proper solution shortly.

@alex-alecu
Copy link
Contributor

@shssoichiro fixed here #6240

@shssoichiro
Copy link
Contributor Author

Thanks! I will close this one then.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Continually prompted whether to implement when in Plan mode

2 participants