{"record":{"id":"d8cbe4ec39e35d2c","repo":"vercel/ai","slug":"the-harnessid-acp-harness-supports-only-portabl","errorCode":null,"errorMessage":"The ${harnessId} ACP harness supports only portable text prompts and does not support image content. Pass a string or a user message whose content contains only text parts.","messagePattern":"The (.+?) ACP harness supports only portable text prompts and does not support image content\\. Pass a string or a user message whose content contains only text parts\\.","errorType":"exception","errorClass":"HarnessCapabilityUnsupportedError","httpStatus":null,"severity":"error","filePath":"packages/harness-acp/src/v1/acp-v1-prompt.ts","lineNumber":35,"sourceCode":"}: {\n  prompt: HarnessV1Prompt;\n  harnessId: string;\n}): ACPTextContentBlock[] {\n  if (typeof prompt === 'string') {\n    return [{ type: 'text', text: prompt }];\n  }\n  if (typeof prompt.content === 'string') {\n    return [{ type: 'text', text: prompt.content }];\n  }\n\n  const content: ACPTextContentBlock[] = [];\n  for (const part of prompt.content) {\n    if (part.type === 'text') {\n      content.push({ type: 'text', text: part.text });\n      continue;\n    }\n    if (part.type === 'image') {\n      throw unsupportedPromptContent({\n        harnessId,\n        category: 'image content',\n      });\n    }\n    if (part.type === 'file') {\n      const mediaCategory = part.mediaType.toLowerCase().split('/', 1)[0];\n      if (mediaCategory === 'image') {\n        throw unsupportedPromptContent({\n          harnessId,\n          category: 'image content',\n        });\n      }\n      if (mediaCategory === 'audio') {\n        throw unsupportedPromptContent({\n          harnessId,\n          category: 'audio content',\n        });\n      }","sourceCodeStart":17,"sourceCodeEnd":53,"githubUrl":"https://github.com/vercel/ai/blob/69428b1f8b037e4d118fb4853428d5c4e620493c/packages/harness-acp/src/v1/acp-v1-prompt.ts#L17-L53","documentation":"convertHarnessPromptToACPTextBlocks rejects prompts containing image content parts. The ACP v1 harness only supports portable text prompts, so any prompt whose message content includes an image part causes this unsupportedPromptContent error before the prompt is sent to the agent.","triggerScenarios":"Prompting an ACP v1 harness session with a user message whose content array contains a part with type: 'image', or any non-string prompt that resolves to image parts.","commonSituations":"Reusing a multimodal chat pipeline (screenshots, image uploads) against an ACP coding-agent harness; passing through user attachments unfiltered.","solutions":["Send a plain string prompt or a user message whose content contains only text parts.","Describe or OCR the image into a text part before prompting.","Filter or reject image parts in your UI/adapter layer before they reach the harness."],"exampleFix":"// before\nawait prompt({ content: [{ type: 'text', text: 'What is this?' }, { type: 'image', image: buf }] });\n// after\nawait prompt({ content: [{ type: 'text', text: 'What is this? (describe the screenshot in words)' }] });","handlingStrategy":"validation","validationCode":"const hasImage = typeof prompt !== 'string' &&\n  typeof prompt.content !== 'string' &&\n  prompt.content.some(p => p.type === 'image');\nif (hasImage) throw new Error('ACP v1 harness prompts must contain only text parts');","typeGuard":"function isTextOnlyPrompt(p: unknown): boolean {\n  if (typeof p === 'string') return true;\n  const q = p as { content?: unknown };\n  if (typeof q.content === 'string') return true;\n  return Array.isArray(q.content) &&\n    q.content.every((part: any) => part?.type === 'text');\n}","tryCatchPattern":"try {\n  await session.prompt(msg);\n} catch (e) {\n  if (String(e?.message).includes('does not support image content')) {\n    await session.prompt(toTextOnly(msg));\n  } else throw e;\n}","preventionTips":["Sanitize message content to text-only parts before any ACP harness prompt","Convert images to textual descriptions in the adapter layer","Hide image upload affordances when the backend is an ACP harness"],"tags":["acp","multimodal","image","unsupported-content"],"backgroundTag":"unsupported-prompt-content","analyzedSha":"69428b1f8b037e4d118fb4853428d5c4e620493c","analyzedAt":"2026-08-30T12:32:21.016Z","schemaVersion":2},"datasetVersion":"2026-08-30T13:17:10.514Z"}