{"record":{"id":"07633c0e3748f43f","repo":"vercel/ai","slug":"acp-permission-mapping-for-json-stringify-permis-07633c","errorCode":null,"errorMessage":"ACP permission mapping for ${JSON.stringify(permissionMode)} assigns string value ${JSON.stringify(target.value)} to boolean session configuration ${JSON.stringify(target.configId)}.","messagePattern":"ACP permission mapping for (.+?) assigns string value (.+?) to boolean session configuration (.+?)\\.","errorType":"exception","errorClass":"HarnessBridgeCapabilityUnsupportedError","httpStatus":null,"severity":"error","filePath":"packages/harness-acp/src/v1/bridge/permission-mode.ts","lineNumber":116,"sourceCode":"  }\n\n  const configOption = sessionConfiguration.configOptions?.find(\n    option => option.id === target.configId,\n  );\n  if (configOption == null) {\n    const availableConfigIds =\n      sessionConfiguration.configOptions?.map(option => option.id) ?? [];\n    throw unsupported({\n      harnessId,\n      message:\n        `ACP permission mapping for ${JSON.stringify(permissionMode)} requires session configuration ` +\n        `${JSON.stringify(target.configId)}, but the agent advertised ` +\n        `${formatChoices({ values: availableConfigIds })}.`,\n    });\n  }\n  if (configOption.type === 'boolean') {\n    if (typeof target.value !== 'boolean') {\n      throw unsupported({\n        harnessId,\n        message:\n          `ACP permission mapping for ${JSON.stringify(permissionMode)} assigns string value ` +\n          `${JSON.stringify(target.value)} to boolean session configuration ${JSON.stringify(target.configId)}.`,\n      });\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","sourceCodeStart":98,"sourceCodeEnd":134,"githubUrl":"https://github.com/vercel/ai/blob/69428b1f8b037e4d118fb4853428d5c4e620493c/packages/harness-acp/src/v1/bridge/permission-mode.ts#L98-L134","documentation":"The mapped permission target assigns a value to an ACP session config option the agent advertised as type 'boolean', but the mapped value is a string. The harness validates value/type compatibility before applying the config and throws this unsupported error to prevent sending an invalid config value to the agent.","triggerScenarios":"configureACPPermissionMode resolves to a config target { configId, value: '<some string>' } while the matching configOption.type === 'boolean'.","commonSituations":"Mapping written for an agent where the option was a select ('true'/'false' strings) reused against an agent exposing it as boolean; hand-written mapping with quoted boolean values.","solutions":["Change the mapping value to a real boolean (true/false) for this boolean config option.","If the option is genuinely string-valued, update the mapping against the correct agent config type.","Inspect configOptions in the session/update payload to confirm each option's type before writing mappings."],"exampleFix":"// before\n{ type: 'config', configId: 'autoApprove', value: 'true' }\n// after\n{ type: 'config', configId: 'autoApprove', value: true }","handlingStrategy":"validation","validationCode":"const opt = sessionConfiguration.configOptions?.find(o => o.id === target.configId);\nif (opt?.type === 'boolean' && typeof target.value !== 'boolean') {\n  throw new Error(`config ${target.configId} expects a boolean`);\n}","typeGuard":"const isBooleanConfigValue = (opt: ConfigOption | undefined, value: unknown): value is boolean =>\n  opt?.type === 'boolean' && typeof value === 'boolean';","tryCatchPattern":null,"preventionTips":["Check each config option's `type` before writing its mapped value.","Use the target runtime's real booleans, never quoted 'true'/'false' strings.","Type mapping values as `string | boolean` and narrow per option type."],"tags":["acp","permissions","type-mismatch","configuration"],"backgroundTag":"config-value-type-mismatch","analyzedSha":"69428b1f8b037e4d118fb4853428d5c4e620493c","analyzedAt":"2026-08-30T12:32:21.016Z","schemaVersion":2},"datasetVersion":"2026-08-30T13:17:10.514Z"}