{"record":{"id":"c56a0dac38616385","repo":"continuedev/continue","slug":"lazy-apply-not-supported-for-model-llm-model","errorCode":null,"errorMessage":"Lazy apply not supported for model ${llm.model}","messagePattern":"Lazy apply not supported for model (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"core/edit/lazy/streamLazyApply.ts","lineNumber":23,"sourceCode":"} from \"../../autocomplete/filtering/streamTransforms/lineStream.js\";\nimport { streamDiff } from \"../../diff/streamDiff.js\";\nimport { LineStream, streamLines } from \"../../diff/util.js\";\nimport { DiffLine, ILLM } from \"../../index.js\";\nimport { stopAtLinesWithMarkdownSupport } from \"../../utils/streamMarkdownUtils.js\";\n\nimport { lazyApplyPromptForModel, UNCHANGED_CODE } from \"./prompts.js\";\nimport { BUFFER_LINES_BELOW, getReplacementWithLlm } from \"./replace.js\";\n\nexport async function* streamLazyApply(\n  oldCode: string,\n  filename: string,\n  newCode: string,\n  llm: ILLM,\n  abortController: AbortController,\n): AsyncGenerator<DiffLine> {\n  const promptFactory = lazyApplyPromptForModel(llm.model, llm.providerName);\n  if (!promptFactory) {\n    throw new Error(`Lazy apply not supported for model ${llm.model}`);\n  }\n\n  const promptMessages = promptFactory(oldCode, filename, newCode);\n  const lazyCompletion = llm.streamChat(promptMessages, abortController.signal);\n\n  // Do find and replace over the lazy edit response\n  async function* replacementFunction(\n    oldCode: string,\n    linesBefore: string[],\n    linesAfter: string[],\n  ): AsyncGenerator<string> {\n    for await (const line of getReplacementWithLlm(\n      oldCode,\n      linesBefore,\n      linesAfter,\n      llm,\n      abortController,\n    )) {","sourceCodeStart":5,"sourceCodeEnd":41,"githubUrl":"https://github.com/continuedev/continue/blob/5522c6f44ca0ac3528b37244818fbfa39b5af470/core/edit/lazy/streamLazyApply.ts#L5-L41","documentation":"streamLazyApply uses lazyApplyPromptForModel to pick a model-specific prompt template for streaming edits; if the model/provider has no registered lazy-apply prompt factory, it throws rather than producing an unusable prompt.","triggerScenarios":"Calling applyCodeBlock with 'lazy' strategy for a model whose name doesn't match any known lazy-apply prompt pattern (custom or uncommon model).","commonSituations":"Using a self-hosted/new model with the lazy apply mode; provider string mismatch; version change renaming recognized models.","solutions":["Switch the apply strategy away from lazy/stream for this model","Add/extend a prompt factory mapping in lazyApplyPromptForModel for your model name","Use a model name matching an existing template (e.g. recognized frontier models)"],"exampleFix":"// before\nconst gen = streamLazyApply(oldCode, filename, newCode, llm, ac);\n// after\nconst factory = lazyApplyPromptForModel(llm.model, llm.providerName);\nif (!factory) throw new Error(\"use non-lazy apply for \" + llm.model);\nconst gen = streamLazyApply(oldCode, filename, newCode, llm, ac);","handlingStrategy":"fallback","validationCode":"import { lazyApplyPromptForModel } from 'core/edit/lazy/lazyPrompt';\nif (!lazyApplyPromptForModel(llm.model, llm.providerName)) { useDirectApply(); }","typeGuard":"const supportsLazyApply = (llm: ILLM) => !!lazyApplyPromptForModel(llm.model, llm.providerName);","tryCatchPattern":"catch (e) { if (e.message.startsWith('Lazy apply not supported')) { applyCodeBlock with non-lazy strategy; } }","preventionTips":["Check model support before choosing the lazy apply strategy","Default to non-lazy apply for unknown models"],"tags":["edit","apply","llm","prompt-template"],"backgroundTag":"unsupported-model","analyzedSha":"5522c6f44ca0ac3528b37244818fbfa39b5af470","analyzedAt":"2026-08-27T11:28:54.683Z","schemaVersion":2},"datasetVersion":"2026-08-27T13:17:12.746Z"}