continuedev/continue · error · Error

Lazy apply not supported for model ${llm.model}

Error message

Lazy apply not supported for model ${llm.model}

What it means

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.

Source

Thrown at core/edit/lazy/streamLazyApply.ts:23

} from "../../autocomplete/filtering/streamTransforms/lineStream.js";
import { streamDiff } from "../../diff/streamDiff.js";
import { LineStream, streamLines } from "../../diff/util.js";
import { DiffLine, ILLM } from "../../index.js";
import { stopAtLinesWithMarkdownSupport } from "../../utils/streamMarkdownUtils.js";

import { lazyApplyPromptForModel, UNCHANGED_CODE } from "./prompts.js";
import { BUFFER_LINES_BELOW, getReplacementWithLlm } from "./replace.js";

export async function* streamLazyApply(
  oldCode: string,
  filename: string,
  newCode: string,
  llm: ILLM,
  abortController: AbortController,
): AsyncGenerator<DiffLine> {
  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);

  // Do find and replace over the lazy edit response
  async function* replacementFunction(
    oldCode: string,
    linesBefore: string[],
    linesAfter: string[],
  ): AsyncGenerator<string> {
    for await (const line of getReplacementWithLlm(
      oldCode,
      linesBefore,
      linesAfter,
      llm,
      abortController,
    )) {

View on GitHub (pinned to 5522c6f44c)

Solutions

  1. Switch the apply strategy away from lazy/stream for this model
  2. Add/extend a prompt factory mapping in lazyApplyPromptForModel for your model name
  3. Use a model name matching an existing template (e.g. recognized frontier models)

Example fix

// before
const gen = streamLazyApply(oldCode, filename, newCode, llm, ac);
// after
const factory = lazyApplyPromptForModel(llm.model, llm.providerName);
if (!factory) throw new Error("use non-lazy apply for " + llm.model);
const gen = streamLazyApply(oldCode, filename, newCode, llm, ac);
Defensive patterns

Strategy: fallback

Validate before calling

import { lazyApplyPromptForModel } from 'core/edit/lazy/lazyPrompt';
if (!lazyApplyPromptForModel(llm.model, llm.providerName)) { useDirectApply(); }

Type guard

const supportsLazyApply = (llm: ILLM) => !!lazyApplyPromptForModel(llm.model, llm.providerName);

Try / catch

catch (e) { if (e.message.startsWith('Lazy apply not supported')) { applyCodeBlock with non-lazy strategy; } }

Prevention

When it happens

Trigger: Calling applyCodeBlock with 'lazy' strategy for a model whose name doesn't match any known lazy-apply prompt pattern (custom or uncommon model).

Common situations: Using a self-hosted/new model with the lazy apply mode; provider string mismatch; version change renaming recognized models.

Related errors


AI-assisted analysis of continuedev/continue@5522c6f44c (2026-08-27). Data as JSON: /api/errors/c56a0dac38616385. Report an issue: GitHub.