fix(jetbrains): continue failed turns on retry - #13520
Merged
Merged
Conversation
Contributor
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Files Reviewed (35 files)
Previous Review Summaries (2 snapshots, latest commit 56dc51e)Current summary above is authoritative. Previous snapshots are kept for context only. Previous review (commit 56dc51e)Status: 1 Issue Found | Recommendation: Address before merge Overview
Issue Details (click to expand)WARNING
Files Reviewed (11 files)
Fix these issues in Kilo Cloud Previous review (commit e702f2a)Status: No Issues Found | Recommendation: Merge Files Reviewed (23 files)
Reviewed by grok-4.6 · Input: 157.5K · Output: 17.4K · Cached: 694.5K Review guidance: REVIEW.md from base branch |
lambertjosh
approved these changes
Aug 27, 2026
A turn whose provider ended the stream without a terminal stop reason closed as "completed" with no message error and no session error, so the session simply went idle and the truncated answer had no explanation. Plumb the assistant finish reason through to the frontend and render a warning outcome card for "unknown" and "other", with the raw reason on the icon tooltip. The notice is seeded from history so it survives reopening the session. "length" is excluded because the CLI already writes a visible warning text part for it. Also broaden the branch/changes refresh from Idle to any non-busy state, so a turn that edited files still refreshes the git indicators when it ends incomplete, failed, interrupted, or in error.
SessionLayout sizes MessageErrorView and then reads its preferred size, but the wrapper's BorderLayout asked the text area for a preferred size without passing that width down. A wrapping JBTextArea answered with one unwrapped line, so a long provider error was clipped to a single-line slot. Measure at the available width the way the transcript's other text rows already do. Dropping the caret reset with it: there is no scroll pane around this area, so its only effect was to let a new failure card yank the transcript scroll to itself.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue
No linked issue; user-reported JetBrains retry regression during local testing.
Context
JetBrains Retry for failed turns was using the rollback/replay path. The CLI's revert semantics widen a whole-message revert to the preceding user message, and the following prompt cleanup can remove that user prompt and everything after it. For a long first turn, that can make the session look like it lost all context and resume from an empty prompt.
This changes Retry to continue the failed turn instead of rolling it back.
Implementation
Retry now reuses the original user message id with an empty part list and does not call revert or delete. That keeps the transcript and workspace untouched, hides the outcome/error card by moving the session to Busy immediately, and lets the continued turn run with the currently selected model and effort.
The failed assistant attempt remains in history when it produced visible output or tool activity; CLI-side recovery already removes output-free failed scaffolding on the next prompt. This intentionally gives up the previous hidden workspace rollback, because reverting behind a Retry button is surprising and the cleanup path can make that rollback unrecoverable.
The retry tests now assert the important safety properties: no revert/delete RPCs, no appended user message, no text part containing "continue", the card leaves failed state on click, double-click retry is blocked by Busy, and live model/effort selections are preserved.
Screenshots / Video
N/A - behavior-only change covered by controller tests.
How to Test
Manual/local verification
./gradlew :frontend:test --tests "ai.kilocode.client.session.controller.SessionRetryTest" --console=plainfrompackages/kilo-jetbrains/passed../gradlew :frontend:test --rerun-tasks --console=plainfrompackages/kilo-jetbrains/passed../gradlew typecheck --console=plainfrompackages/kilo-jetbrains/passed.bun turbo typecheck "--filter=!@kilocode/kilo-jetbrains"andbun turbo typecheck "--filter=@kilocode/kilo-jetbrains"; both passed.Reviewer test steps
continueuser message appears, previous transcript content remains visible, and the new assistant attempt uses the selected model/effort.Blocked checks and substitute verification
./gradlew :frontend:detekt --console=plainfails on the existing baseline with 1421 weighted issues; this is not part of the documented JetBrains quality gate. Touched-file lint viaoxlinthad 0 warnings/errors where applicable, and the relevant Gradle test/typecheck checks passed.Checklist
Get in Touch
N/A