{"record":{"id":"56e5265c5668016f","repo":"vercel/ai","slug":"harnessid-does-not-support-structured-output-th","errorCode":null,"errorMessage":"${harnessId} does not support structured output through ACP.","messagePattern":"(.+?) does not support structured output through ACP\\.","errorType":"exception","errorClass":"HarnessCapabilityUnsupportedError","httpStatus":null,"severity":"error","filePath":"packages/harness-acp/src/v1/acp-v1-harness.ts","lineNumber":1411,"sourceCode":"  };\n\n  return {\n    sessionId,\n    isResume,\n    doPromptTurn: async options => {\n      await synchronizeSkills({\n        skills: options.skills,\n        abortSignal: options.abortSignal,\n      });\n      if (options.responseFormat?.type === 'json') {\n        if (options.responseFormat.schema == null) {\n          throw unsupported({\n            harnessId,\n            message: `${harnessId} requires a JSON schema for structured output.`,\n          });\n        }\n        if (outputSchemaMapping == null) {\n          throw unsupported({\n            harnessId,\n            message: `${harnessId} does not support structured output through ACP.`,\n          });\n        }\n      }\n      if (replayOnly) {\n        throw new Error(\n          `${harnessId} recovered this turn through disk replay only and has no restored ACP process for a subsequent prompt.`,\n        );\n      }\n      if (options.abortSignal?.aborted) {\n        throw (\n          options.abortSignal.reason ??\n          new DOMException('Aborted', 'AbortError')\n        );\n      }\n      const prompt = convertHarnessPromptToACPTextBlocks({\n        prompt: options.prompt,","sourceCodeStart":1393,"sourceCodeEnd":1429,"githubUrl":"https://github.com/vercel/ai/blob/69428b1f8b037e4d118fb4853428d5c4e620493c/packages/harness-acp/src/v1/acp-v1-harness.ts#L1393-L1429","documentation":"Thrown by createSession in the ACP v1 harness when a structured-output (responseFormat.type === 'json') turn is requested but no outputSchemaMapping was configured. The ACP protocol needs an explicit mapping from the JSON schema to the agent's output format; without it the harness cannot translate the request, so it refuses up front with an 'unsupported' error instead of failing mid-turn.","triggerScenarios":"Calling a turn/session API with options.responseFormat set to { type: 'json' } on an ACP v1 harness while outputSchemaMapping is null or undefined at the point createSession runs.","commonSituations":"Enabling structured output generically across harnesses without checking ACP support; forgetting to supply the ACP output-schema mapping option; using a harness/adapter version where the mapping is not wired through.","solutions":["Provide a valid outputSchemaMapping alongside the JSON responseFormat when creating the ACP v1 session.","If the harness cannot provide a mapping, remove responseFormat and request plain text output, parsing it yourself.","Check the harness documentation for ACP structured-output support before using responseFormat.type === 'json'."],"exampleFix":"// before\nawait createACPV1({ responseFormat: { type: 'json' } });\n// after\nawait createACPV1({\n  responseFormat: { type: 'json' },\n  outputSchemaMapping: mySchemaMapping,\n});","handlingStrategy":"validation","validationCode":"if (options.responseFormat?.type === 'json' && outputSchemaMapping == null) {\n  throw new Error('Provide outputSchemaMapping for JSON structured output on ACP v1 harnesses');\n}","typeGuard":null,"tryCatchPattern":"try {\n  await createACPV1(options);\n} catch (e) {\n  if (isUnsupportedError(e)) {\n    // fall back to text output\n    await createACPV1({ ...options, responseFormat: undefined });\n  } else throw e;\n}","preventionTips":["Only enable responseFormat.type === 'json' when an outputSchemaMapping is available for the harness","Centralize harness capability checks in one helper before session creation","Feature-flag structured output per harness type"],"tags":["acp","structured-output","unsupported-capability"],"backgroundTag":"unsupported-structured-output","analyzedSha":"69428b1f8b037e4d118fb4853428d5c4e620493c","analyzedAt":"2026-08-30T12:32:21.016Z","schemaVersion":2},"datasetVersion":"2026-08-30T13:17:10.514Z"}