Skip to content

fix(plan): prevent "Continue here" popup from repeating#9182

Closed
kagura-agent wants to merge 1 commit intoKilo-Org:mainfrom
kagura-agent:fix/plan-exit-repeat-popup
Closed

fix(plan): prevent "Continue here" popup from repeating#9182
kagura-agent wants to merge 1 commit intoKilo-Org:mainfrom
kagura-agent:fix/plan-exit-repeat-popup

Conversation

@kagura-agent
Copy link
Copy Markdown

Problem

When using plan mode, after the agent calls plan_exit and presents the "Ready to implement?" prompt, selecting "Continue here" causes the popup to appear again repeatedly (fixes #9144).

Root Cause

shouldAskPlanFollowup checks whether any assistant message after the last user message contains a completed plan_exit tool call. However, it does not account for the case where "Continue here" has already been selected — the injected synthetic user message (with agent: "code") should signal that the plan-to-code transition already happened.

Fix

Added a guard in shouldAskPlanFollowup: if the last user message's agent is not "plan", skip the follow-up prompt. When "Continue here" injects a user message with agent: "code", subsequent loop iterations will no longer trigger the popup.

Changes

  • packages/opencode/src/kilocode/session/prompt.ts: Added agent check in shouldAskPlanFollowup
  • packages/opencode/test/kilocode/plan-exit-detection.test.ts: Added test verifying no re-trigger after "Continue here"
  • .changeset/fix-plan-exit-repeat.md: Patch changeset

Testing

  • Added unit test: seeds a plan session with plan_exit, then injects a "Continue here" user message with agent: "code", and asserts shouldAskPlanFollowup returns false
  • Existing tests continue to pass (plan_exit detection, continue flow, dismiss, etc.)

When "Continue here" is selected, a synthetic user message is injected
with agent="code". shouldAskPlanFollowup now checks the last user
message's agent — if it's not "plan", the follow-up prompt is skipped,
preventing the popup from appearing repeatedly.
@kilo-code-bot
Copy link
Copy Markdown
Contributor

kilo-code-bot Bot commented Apr 19, 2026

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (3 files)
  • .changeset/fix-plan-exit-repeat.md
  • packages/opencode/src/kilocode/session/prompt.ts
  • packages/opencode/test/kilocode/plan-exit-detection.test.ts

Reviewed by gpt-5.4-20260305 · 560,954 tokens

@kagura-agent
Copy link
Copy Markdown
Author

Closing — this was fixed in #9245. Thanks!

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.

Plan exit's "continue here" option repeatedly pops up

1 participant