deepseek-ai/deepseek-harness · error · AcpContentError

invalid

invalid

Error message

image mimeType must be image/png, image/jpeg, image/webp, or image/gif

What it means

Error "image mimeType must be image/png, image/jpeg, image/webp, or image/gif" thrown in deepseek-ai/deepseek-harness.

Source

Thrown at packages/acp/acp/src/content.ts:50

   * @param options - optional causal chain for diagnostics.
   */
  constructor(message: string, kind: AcpContentFailureKind, options?: ErrorOptions) {
    super(message, options)
    this.name = 'AcpContentError'
    this.kind = kind
  }
}

/** Narrow a wire MIME string to the durable raster vocabulary. */
function imageMediaType(value: string): ImageMediaType | undefined {
  return IMAGE_MEDIA_TYPES.includes(value as ImageMediaType) ? value as ImageMediaType : undefined
}

/** Strictly decode one ACP inline image without accepting base64 aliases. */
function decodeImage(block: Extract<AcpContentBlock, { type: 'image' }>): SaveImageAttachment {
  const mediaType = imageMediaType(block.mimeType)
  if (mediaType === undefined) {
    throw new AcpContentError('image mimeType must be image/png, image/jpeg, image/webp, or image/gif', 'invalid')
  }
  if (!CANONICAL_BASE64.test(block.data)) {
    throw new AcpContentError('image data must be canonical base64', 'invalid')
  }
  const data = Buffer.from(block.data, 'base64')
  if (data.toString('base64') !== block.data) {
    throw new AcpContentError('image data must be canonical base64', 'invalid')
  }
  return { data, mediaType }
}

/** Resolve the exact current route and require explicit image input support. */
async function assertImageRoute(ctx: Context, agent: Agent, signal: AbortSignal): Promise<void> {
  const routed = agent.session.requestHeader()?.config
  const provider = routed?.provider ?? agent.options.provider
  const model = routed?.model ?? agent.options.model
  const llm = ctx.get('llm')
  if (provider === undefined || model === undefined || llm === undefined) {

View on GitHub (pinned to b150a551b8)

Solutions

  1. Send only image/png, image/jpeg, image/webp, or image/gif attachments; convert other formats to one of these before attaching.

When it happens

Trigger: Thrown at packages/acp/acp/src/content.ts:50 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/36072d810771944f. Report an issue: GitHub.