{"record":{"id":"07875b11441bb4f3","repo":"vercel/ai","slug":"the-harnessid-acp-harness-supports-only-portabl-07875b","errorCode":null,"errorMessage":"The ${harnessId} ACP harness supports only portable text prompts and does not support embedded resource content with media type ${JSON.stringify(part.mediaType)}. 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 embedded resource content with media type (.+?)\\. 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":54,"sourceCode":"        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      }\n      throw unsupportedPromptContent({\n        harnessId,\n        category: `embedded resource content with media type ${JSON.stringify(part.mediaType)}`,\n      });\n    }\n    throw unsupportedPromptContent({\n      harnessId,\n      category: `content parts of type ${JSON.stringify(\n        (part as { readonly type?: unknown }).type,\n      )}`,\n    });\n  }\n  return content;\n}\n\nexport function prependACPInstructionGuidance({\n  prompt,\n  instructions,\n}: {","sourceCodeStart":36,"sourceCodeEnd":72,"githubUrl":"https://github.com/vercel/ai/blob/69428b1f8b037e4d118fb4853428d5c4e620493c/packages/harness-acp/src/v1/acp-v1-prompt.ts#L36-L72","documentation":"Fallback for non-image, non-audio file parts: convertHarnessPromptToACPTextBlocks rejects any embedded resource (file) content whose media type is not explicitly handled, reporting the exact media type in the message. ACP v1 prompts may contain text blocks only.","triggerScenarios":"Prompting an ACP v1 harness with a file part of any other media type (e.g. application/pdf, video/mp4, text/csv as a file part).","commonSituations":"Attaching PDFs, videos, or data files to prompts and assuming the harness will forward them like a full multimodal provider.","solutions":["Extract the relevant content into a text part (e.g. paste the PDF text) instead of attaching the file.","Provide file contents via the agent's own file-system/workspace tools rather than prompt parts.","Pre-validate and strip non-text parts from prompts sent to ACP v1 harnesses."],"exampleFix":"// before\ncontent: [{ type: 'file', mediaType: 'application/pdf', data }]\n// after\ncontent: [{ type: 'text', text: pdfExtractedText }]","handlingStrategy":"validation","validationCode":"const hasNonTextFile = typeof prompt !== 'string' &&\n  typeof prompt.content !== 'string' &&\n  prompt.content.some(p => p.type === 'file');\nif (hasNonTextFile) throw new Error('ACP v1 harness prompts cannot include file/resource parts; inline the content as text');","typeGuard":"function hasFileParts(prompt: unknown): boolean {\n  const p = prompt as { content?: unknown };\n  return Array.isArray(p?.content) &&\n    (p.content as any[]).some(part => part?.type === 'file');\n}","tryCatchPattern":"try {\n  await session.prompt(msg);\n} catch (e) {\n  if (String(e?.message).includes('embedded resource content')) {\n    await session.prompt(inlineFilesAsText(msg));\n  } else throw e;\n}","preventionTips":["Extract text from documents (PDF, CSV) before prompting instead of attaching files","Deliver binary artifacts via the agent's workspace, not prompt parts","Keep a single toTextOnlyPrompt() normalizer used for all harness prompts"],"tags":["acp","multimodal","file","unsupported-content"],"backgroundTag":"unsupported-prompt-content","analyzedSha":"69428b1f8b037e4d118fb4853428d5c4e620493c","analyzedAt":"2026-08-30T12:32:21.016Z","schemaVersion":2},"datasetVersion":"2026-08-30T13:17:10.514Z"}