deepseek-ai/deepseek-harness · error · LlmError

INVALID_REQUEST

INVALID_REQUEST

Error message

DeepSeek request image ${block.attachment.attachmentId} was not prepared.

What it means

Error "DeepSeek request image ${block.attachment.attachmentId} was not prepared." thrown in deepseek-ai/deepseek-harness.

Source

Thrown at packages/llm/llm-deepseek/src/serialize.ts:146

  version: RequestImageAttachment,
  precededByContent: boolean,
): WireTextContentPart {
  return {
    type: 'text',
    text: `${precededByContent ? '\n' : ''}${requestImageHandleText(version)}`,
  }
}

/** Resolve one durable image into its descriptor and transient DeepSeek image part. */
async function imageParts(
  block: Extract<ContentBlock, { type: 'image' }>,
  images: ImageSerializationOptions,
  location: ImageWireLocation,
  precededByContent: boolean,
): Promise<[WireTextContentPart, WireImageContentPart]> {
  const version = images.requestImages.get(block.attachment.attachmentId)
  if (version === undefined) {
    throw new LlmError(
      `DeepSeek request image ${block.attachment.attachmentId} was not prepared.`,
      'INVALID_REQUEST',
    )
  }
  const image: WireImageContentPart = images.representation.kind === 'file'
    ? { type: 'file', file_id: await images.representation.resolveFileId(version, block, location) }
    : {
      type: 'image_url',
      image_url: { url: `data:${version.mediaType};base64,${Buffer.from(version.data).toString('base64')}` },
    }
  return [imageHandle(version, precededByContent), image]
}

/** Convert user or nested tool-result blocks into ordered wire parts. */
async function contentParts(
  blocks: readonly ContentBlock[],
  images: ImageSerializationOptions,
  message: number,

View on GitHub (pinned to b150a551b8)

Solutions

  1. Let attachment preparation finish before sending the request; retry if the image was dropped.

When it happens

Trigger: Thrown at packages/llm/llm-deepseek/src/serialize.ts:146 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of deepseek-ai/deepseek-harness@b150a551b8 (2026-08-24). Data as JSON: /api/errors/0720c2cfa4bd6425. Report an issue: GitHub.