{"record":{"id":"89f5d649a554ee16","repo":"vercel/ai","slug":"permission-mode-json-stringify-permissionmode","errorCode":null,"errorMessage":"Permission mode ${JSON.stringify(permissionMode)} is not supported by this ACP harness. Use permissionMode: 'allow-all'.","messagePattern":"Permission mode (.+?) is not supported by this ACP harness\\. Use permissionMode: 'allow-all'\\.","errorType":"exception","errorClass":"HarnessBridgeCapabilityUnsupportedError","httpStatus":null,"severity":"error","filePath":"packages/harness-acp/src/v1/bridge/permission-mode.ts","lineNumber":37,"sourceCode":"\nexport async function configureACPPermissionMode({\n  agent,\n  sessionId,\n  sessionConfiguration,\n  permissionModeMapping,\n  permissionMode,\n  harnessId,\n}: {\n  agent: acp.ClientContext;\n  sessionId: string;\n  sessionConfiguration: ACPSessionConfiguration;\n  permissionModeMapping: ACPPermissionModeMapping;\n  permissionMode: HarnessV1PermissionMode;\n  harnessId: string;\n}): Promise<void> {\n  const target = permissionModeMapping[permissionMode];\n  if (target == null) {\n    throw unsupported({\n      harnessId,\n      message:\n        `Permission mode ${JSON.stringify(permissionMode)} is not supported by this ACP harness.` +\n        (permissionModeMapping['allow-all'] == null\n          ? ''\n          : ` Use permissionMode: 'allow-all'.`),\n    });\n  }\n\n  for (const mappedPermissionMode of PERMISSION_MODES) {\n    const mappedTarget = permissionModeMapping[mappedPermissionMode];\n    if (mappedTarget != null) {\n      validateTarget({\n        target: mappedTarget,\n        permissionMode: mappedPermissionMode,\n        sessionConfiguration,\n        harnessId,\n      });","sourceCodeStart":19,"sourceCodeEnd":55,"githubUrl":"https://github.com/vercel/ai/blob/69428b1f8b037e4d118fb4853428d5c4e620493c/packages/harness-acp/src/v1/bridge/permission-mode.ts#L19-L55","documentation":"The ACP harness maps each HarnessV1PermissionMode (e.g. 'default', 'allow-all') to an ACP-specific target via a per-harness `permissionModeMapping`. If the requested mode has no entry in that mapping, the harness refuses to configure permissions and throws an unsupported error, suggesting 'allow-all' when that mode is available. This is a configuration guard, not a runtime failure.","triggerScenarios":"Calling ensureSession / configureACPPermissionMode with a permissionMode (e.g. 'default' or a mode string) for which the specific ACP harness's ACPPermissionModeMapping has no entry (mapping[permissionMode] === null/undefined).","commonSituations":"Passing a Harness-level permission mode that the chosen ACP agent does not support (e.g. an agent with no approval concept); copy-pasting a mode value from a different harness; typos in the mode string.","solutions":["Switch to permissionMode: 'allow-all', which the mapping supports when the suggestion is shown.","Check the harness's ACPPermissionModeMapping to see which permission modes are actually mapped.","Add a mapping entry for the desired mode to your harness configuration if the agent can support it."],"exampleFix":"// before\nconst session = await agent.ensureSession({ permissionMode: 'ask-user' });\n// after\nconst session = await agent.ensureSession({ permissionMode: 'allow-all' });","handlingStrategy":"validation","validationCode":"const supported = (mapping, mode) => mapping[mode] != null;\nif (!supported(permissionModeMapping, permissionMode)) {\n  permissionMode = 'allow-all';\n}","typeGuard":"function isSupportedMode(\n  m: HarnessV1PermissionMode,\n  mapping: ACPPermissionModeMapping,\n): m is keyof ACPPermissionModeMapping {\n  return mapping[m] != null;\n}","tryCatchPattern":null,"preventionTips":["Check the harness's permissionModeMapping before choosing a permissionMode.","Centralize the permissionMode value in one constant per harness instead of inlining strings.","Prefer 'allow-all' for agents without an approval concept."],"tags":["acp","permissions","configuration","unsupported-mode"],"backgroundTag":"unsupported-permission-mode","analyzedSha":"69428b1f8b037e4d118fb4853428d5c4e620493c","analyzedAt":"2026-08-30T12:32:21.016Z","schemaVersion":2},"datasetVersion":"2026-08-30T13:17:10.514Z"}