{"record":{"id":"99d4b2bd797243d9","repo":"deepseek-ai/deepseek-harness","slug":"unsupported-content-99d4b2","errorCode":"UNSUPPORTED_CONTENT","errorMessage":"pi-ai cannot represent an image in an in-history ${message.role} message","messagePattern":"pi-ai cannot represent an image in an in-history (.+?) message","errorType":"exception","errorClass":"LlmError","httpStatus":null,"severity":"error","filePath":"packages/llm/llm-pi-ai/src/context.ts","lineNumber":40,"sourceCode":"  return message.content\n    .filter(block => block.type === 'text')\n    .map(block => block.text)\n    .join('')\n}\n\n\n/** Flatten text recursively inside one tool result. */\nfunction toolResultText(blocks: readonly ContentBlock[]): string {\n  return blocks.map(block => block.type === 'text'\n    ? block.text\n    : block.type === 'tool-result' ? toolResultText(block.content) : '').join('')\n}\n\n/** Reject image roles that pi-ai cannot replay before request-size offloading can replace them. */\nfunction assertSupportedImageRoles(messages: readonly Message[]): void {\n  for (const message of messages) {\n    if (message.role !== 'user' && contentHasImage(message.content)) {\n      throw new LlmError(\n        `pi-ai cannot represent an image in an in-history ${message.role} message`,\n        'UNSUPPORTED_CONTENT',\n      )\n    }\n  }\n}\n\nasync function userContent(\n  blocks: readonly ContentBlock[],\n  requestImages: ReadonlyMap<AttachmentId, RequestImageAttachment>,\n): Promise<string | (TextContent | ImageContent)[]> {\n  const content: (TextContent | ImageContent)[] = []\n  for (const block of blocks) {\n    switch (block.type) {\n      case 'text':\n        if (block.text.length > 0) content.push({ type: 'text', text: block.text })\n        break\n      case 'image': {","sourceCodeStart":22,"sourceCodeEnd":58,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/llm/llm-pi-ai/src/context.ts#L22-L58","documentation":"Error \"pi-ai cannot represent an image in an in-history ${message.role} message\" thrown in deepseek-ai/deepseek-harness.","triggerScenarios":"Thrown at packages/llm/llm-pi-ai/src/context.ts:40 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Remove the image from the in-history message, or use a protocol that can represent images in that role."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"b150a551b8d465e31e418e1b2eaf5e79bbb7d28e","analyzedAt":"2026-08-24T18:12:29.105Z","schemaVersion":2},"datasetVersion":"2026-08-24T22:17:12.610Z"}