From 46f092250bd561d97484fbf74eeee5ceec792abe Mon Sep 17 00:00:00 2001 From: ajayjha1 Date: Fri, 22 May 2026 14:37:56 +0530 Subject: [PATCH] fix: support lazy apply for non-Sonnet models like qwen3-coder-plus lazyApplyPromptForModel returned undefined for any model not containing 'sonnet', causing streamLazyApply to throw 'Lazy apply not supported' whenever edit_existing_file fell back to the LLM-based apply path. Use the general-purpose prompt as the default for all models. --- core/edit/lazy/prompts.ts | 8 ++------ core/edit/lazy/streamLazyApply.ts | 4 ---- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/core/edit/lazy/prompts.ts b/core/edit/lazy/prompts.ts index 1f2b5c02614..3dcb3ad5c55 100644 --- a/core/edit/lazy/prompts.ts +++ b/core/edit/lazy/prompts.ts @@ -54,10 +54,6 @@ function claudeSonnetLazyApplyPrompt( export function lazyApplyPromptForModel( model: string, provider: string, -): LazyApplyPrompt | undefined { - if (model.includes("sonnet")) { - return claudeSonnetLazyApplyPrompt; - } - - return undefined; +): LazyApplyPrompt { + return claudeSonnetLazyApplyPrompt; } diff --git a/core/edit/lazy/streamLazyApply.ts b/core/edit/lazy/streamLazyApply.ts index f806e956f4c..11f2a115056 100644 --- a/core/edit/lazy/streamLazyApply.ts +++ b/core/edit/lazy/streamLazyApply.ts @@ -19,10 +19,6 @@ export async function* streamLazyApply( abortController: AbortController, ): AsyncGenerator { const promptFactory = lazyApplyPromptForModel(llm.model, llm.providerName); - if (!promptFactory) { - throw new Error(`Lazy apply not supported for model ${llm.model}`); - } - const promptMessages = promptFactory(oldCode, filename, newCode); const lazyCompletion = llm.streamChat(promptMessages, abortController.signal);