{"record":{"id":"c3b045a40bd0c942","repo":"vercel/ai","slug":"acp-permission-mapping-for-json-stringify-permis-c3b045","errorCode":null,"errorMessage":"ACP permission mapping for ${JSON.stringify(permissionMode)} requires value ${JSON.stringify(target.value)} for session configuration ${JSON.stringify(target.configId)}, but the agent advertised ${formatChoices({ values: availableValues })}.","messagePattern":"ACP permission mapping for (.+?) requires value (.+?) for session configuration (.+?), but the agent advertised (.+?)\\)\\}\\.","errorType":"exception","errorClass":"HarnessBridgeCapabilityUnsupportedError","httpStatus":null,"severity":"error","filePath":"packages/harness-acp/src/v1/bridge/permission-mode.ts","lineNumber":139,"sourceCode":"      });\n    }\n    return;\n  }\n  if (typeof target.value !== 'string') {\n    throw unsupported({\n      harnessId,\n      message:\n        `ACP permission mapping for ${JSON.stringify(permissionMode)} assigns boolean value ` +\n        `${JSON.stringify(target.value)} to select session configuration ${JSON.stringify(target.configId)}.`,\n    });\n  }\n  const availableValues = configOption.options.flatMap(option =>\n    'options' in option\n      ? option.options.map(value => value.value)\n      : [option.value],\n  );\n  if (!availableValues.includes(target.value)) {\n    throw unsupported({\n      harnessId,\n      message:\n        `ACP permission mapping for ${JSON.stringify(permissionMode)} requires value ` +\n        `${JSON.stringify(target.value)} for session configuration ${JSON.stringify(target.configId)}, ` +\n        `but the agent advertised ${formatChoices({ values: availableValues })}.`,\n    });\n  }\n}\n\nfunction formatChoices({ values }: { values: ReadonlyArray<string> }): string {\n  return values.length === 0\n    ? 'no matching choices'\n    : values.map(value => JSON.stringify(value)).join(', ');\n}\n\nfunction unsupported({\n  harnessId,\n  message,","sourceCodeStart":121,"sourceCodeEnd":157,"githubUrl":"https://github.com/vercel/ai/blob/69428b1f8b037e4d118fb4853428d5c4e620493c/packages/harness-acp/src/v1/bridge/permission-mode.ts#L121-L157","documentation":"For a select-type session config option, validateTarget collects every value the agent advertised (flattening nested option groups) and verifies the mapped value is among them. If not, the harness throws this unsupported error listing the values the agent actually accepts.","triggerScenarios":"configureACPPermissionMode resolves to a config target whose string value is not contained in the flattened availableValues of the matching select configOption.","commonSituations":"Mapping referencing an old value name after the agent renamed choices (e.g. 'yolo' vs 'bypass-all'); copying a mapping between agents with different value vocabularies; case mismatches in value strings.","solutions":["Set the mapping value to one of the advertised values listed in the error message.","Update the permissionModeMapping after checking the agent's current config option choices.","If the needed value isn't offered at all, choose a different permissionMode or request the value from the agent maintainers."],"exampleFix":"// before\n{ type: 'config', configId: 'approval', value: 'yolo' }\n// after\n{ type: 'config', configId: 'approval', value: 'bypass-all' }","handlingStrategy":"validation","validationCode":"const values = (opt.options ?? []).flatMap(o => 'options' in o ? o.options.map(v => v.value) : [o.value]);\nif (!values.includes(target.value)) {\n  throw new Error(`value ${target.value} not offered; available: ${values.join(', ')}`);\n}","typeGuard":"const isAdvertisedValue = (opt: ConfigOption, value: string): boolean =>\n  (opt.options ?? []).flatMap(o => 'options' in o ? o.options.map(v => v.value) : [o.value]).includes(value);","tryCatchPattern":null,"preventionTips":["Validate mapped values against the advertised choices before calling configure.","Refresh mappings after agent upgrades that can rename select choices.","Match value strings exactly, including casing."],"tags":["acp","permissions","enum-value","configuration"],"backgroundTag":"config-value-type-mismatch","analyzedSha":"69428b1f8b037e4d118fb4853428d5c4e620493c","analyzedAt":"2026-08-30T12:32:21.016Z","schemaVersion":2},"datasetVersion":"2026-08-30T13:17:10.514Z"}