fix(vscode): deduplicate fatal autocomplete notification for next-edit provider#11569
fix(vscode): deduplicate fatal autocomplete notification for next-edit provider#11569markijbema wants to merge 5 commits into
Conversation
…t provider Mirror the FIM path's pause/notify semantics in NextEditInlineCompletionProvider: - Add ErrorBackoff instance and fatalNotified flag to gate repeated notifications - Block all requests once a fatal (401/402) is recorded via backoff.blocked() - Only call onFatalError once per fatal episode via fatalNotified guard - Add resetBackoff() method cleared on auth/connection state changes - Call nextEditProvider.resetBackoff() alongside classic provider in AutocompleteServiceManager Co-authored-by: kiloconnect[bot] <240665456+kiloconnect[bot]@users.noreply.github.com>
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Files Reviewed (3 files)
Previous Review Summaries (2 snapshots, latest commit f3ec065)Current summary above is authoritative. Previous snapshots are kept for context only. Previous review (commit f3ec065)Status: No Issues Found | Recommendation: Merge Files Reviewed (3 files)
Previous review (commit 8acd647)Status: 2 Issues Found | Recommendation: Address before merge Overview
Issue Details (click to expand)WARNING
Fix these issues in Kilo Cloud Files Reviewed (3 files)
Reviewed by gpt-5.4-20260305 · Input: 94.9K · Output: 7.4K · Cached: 490K Review guidance: REVIEW.md from base branch |
Bring NextEditInlineCompletionProvider to full parity with the FIM path: - On a successful (non-throwing) Mercury response, call backoff.success() and clear fatalNotified so each fatal episode notifies exactly once. - When blocked by a 402, periodically probe the balance endpoint (hasBalance) and resume autocomplete if the user topped up, instead of waiting for an auth/reconnect event. Co-authored-by: kiloconnect[bot] <240665456+kiloconnect[bot]@users.noreply.github.com>
Co-authored-by: kiloconnect[bot] <240665456+kiloconnect[bot]@users.noreply.github.com>
Both the FIM and next-edit providers hand-rolled the same pause/notify/recover state machine around ErrorBackoff (blocked-gate + 402 balance probe, notify-once latch, reset-on-success, hasBalance). Extract that orchestration into a single BackoffGate so the two providers can't drift apart again — the exact divergence that let next-edit spam the paused notification. No behavior change. Co-authored-by: kiloconnect[bot] <240665456+kiloconnect[bot]@users.noreply.github.com>
|
Refactored to remove the duplication: the pause/notify/recover state machine that both providers were hand-rolling (blocked-gate + 402 balance probe, notify-once latch, reset-on-success, |
…hout errors, fix issue with reasoning opaque not being picked up for gemini models (Kilo-Org#11569)
What
Fixes the bug where the "Kilo Code autocomplete has been paused" notification fires on every keystroke when the Inception next-edit provider is configured and the user is not logged in. Brings the next-edit provider to full parity with the classic FIM pause/recover behavior.
Why
NextEditInlineCompletionProvider.handleError()had no circuit breaker: every 401/402 response firedonFatalError, popping the toast again. The classic FIM path already handles this correctly viaErrorBackoff+ afatalNotifiedguard + a 402 balance probe.Changes
NextEditInlineCompletionProvider:ErrorBackoffinstance and afatalNotifiedflag.provideInlineCompletionItemsreturns[]immediately whenbackoff.blocked()(no network request). When blocked on a 402, it periodically probes the balance endpoint (hasBalance()) and resumes if the user topped up — matching FIM's self-heal.backoff.success()and clearsfatalNotified, so each fatal episode notifies exactly once.handleErrorcallsbackoff.failure(err)and only invokesonFatalErroronce per fatal episode.resetBackoff()clears bothbackoffandfatalNotified.AutocompleteServiceManager:nextEditProvider.resetBackoff()alongsideinlineCompletionProvider.resetBackoff()in both theonStateChangeandglobal.disposedhandlers, so a re-auth or reconnect (e.g. login) unblocks the next-edit path too.Behavior after this change (consistent with FIM)
global.disposed/ a connection state change, which resets the backoff).