Skip to content

fix(vscode): stop flashing interruption warning on queued follow-up handoff - #12639

Merged
marius-kilocode merged 1 commit into
mainfrom
fix-premature-stop-warning-flicker
Jul 29, 2026
Merged

fix(vscode): stop flashing interruption warning on queued follow-up handoff#12639
marius-kilocode merged 1 commit into
mainfrom
fix-premature-stop-warning-flicker

Conversation

@marius-kilocode

Copy link
Copy Markdown
Collaborator

Sending a follow-up message while a session is still running queues the prompt behind the active turn. The active turn then breaks out of its loop after the current LLM step drains so the queued prompt can take over. That deliberate handoff was recorded with the turn close reason "interrupted", and the webview renders a yellow "Turn interrupted." warning card whenever a session sits idle with that close reason. Between the old turn closing and the queued turn starting there is a brief idle window, so the card flashed on screen and vanished again, suggesting a premature stop that never happened.

The queue handoff now publishes a dedicated "superseded" close reason instead of "interrupted":

  • The turn-close event schema gains the new literal and the prompt loop records it on the handoff break. Memory digests still treat the cut-short turn as interrupted, and attention sounds plus the TUI indicator are unaffected (they key off "completed" and MessageAbortedError respectively).
  • The extension and webview extend their close-reason unions, and the webview terminal-state logic returns no warning for superseded turns. The follow-up turn closes with its own reason right after, so no state lingers.
  • Real interruptions (Esc, cancel) still close as "interrupted" and still surface the warning.

Covered by a new backend integration test that queues a follow-up mid-turn against a held-open mock LLM stream and asserts both close reasons, plus a webview unit test for the superseded terminal state.

…andoff

A prompt sent while a session is running queues behind the active turn,
which breaks out of its loop after the current LLM step drains. That
handoff was recorded with close reason "interrupted", so the webview
rendered the yellow "Turn interrupted." card during the brief idle
window before the queued turn started.

The handoff now closes with a dedicated "superseded" reason instead.
Clients extend their close-reason unions and the webview suppresses the
terminal warning card for superseded turns; memory digests still treat
the cut-short turn as interrupted, and real user interruptions are
unchanged.
@marius-kilocode
marius-kilocode enabled auto-merge (squash) July 29, 2026 10:32
@kilo-code-bot

kilo-code-bot Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (11 files)
  • .changeset/superseded-turn-close.md
  • packages/kilo-vscode/src/kilo-provider-utils.ts
  • packages/kilo-vscode/tests/unit/session-outcome.test.ts
  • packages/kilo-vscode/webview-ui/src/context/session-outcome.ts
  • packages/kilo-vscode/webview-ui/src/types/messages/sessions.ts
  • packages/opencode/src/kilocode/memory/turn.ts
  • packages/opencode/src/kilocode/session/event.ts
  • packages/opencode/src/session/prompt.ts
  • packages/opencode/test/kilocode/session-prompt-queue.test.ts
  • packages/sdk/js/src/v2/gen/types.gen.ts
  • packages/sdk/openapi.json (generated drift, unrelated to this change)

Reviewed by claude-sonnet-5 · Input: 36 · Output: 6.1K · Cached: 987.9K

Review guidance: REVIEW.md from base branch main

@marius-kilocode
marius-kilocode disabled auto-merge July 29, 2026 10:39
@marius-kilocode
marius-kilocode merged commit e4fcb06 into main Jul 29, 2026
44 of 46 checks passed
@marius-kilocode
marius-kilocode deleted the fix-premature-stop-warning-flicker branch July 29, 2026 11:07
unixcrh pushed a commit to unixcrh/kilocode that referenced this pull request Aug 1, 2026
t7tran pushed a commit to t7tran/kilocode that referenced this pull request Aug 14, 2026
t7tran pushed a commit to t7tran/kilocode that referenced this pull request Aug 14, 2026
…rning-flicker

fix(vscode): stop flashing interruption warning on queued follow-up handoff
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.

2 participants