{"record":{"id":"72653a30bcd07d48","repo":"vercel/ai","slug":"acp-permission-mapping-for-json-stringify-permis-72653a","errorCode":null,"errorMessage":"ACP permission mapping for ${JSON.stringify(permissionMode)} assigns boolean value ${JSON.stringify(target.value)} to select session configuration ${JSON.stringify(target.configId)}.","messagePattern":"ACP permission mapping for (.+?) assigns boolean value (.+?) to select session configuration (.+?)\\.","errorType":"exception","errorClass":"HarnessBridgeCapabilityUnsupportedError","httpStatus":null,"severity":"error","filePath":"packages/harness-acp/src/v1/bridge/permission-mode.ts","lineNumber":126,"sourceCode":"      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\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 })}.`,","sourceCodeStart":108,"sourceCodeEnd":144,"githubUrl":"https://github.com/vercel/ai/blob/69428b1f8b037e4d118fb4853428d5c4e620493c/packages/harness-acp/src/v1/bridge/permission-mode.ts#L108-L144","documentation":"Mirror of the boolean case: the mapped permission target assigns a boolean value to a session config option the agent advertised as a 'select' type (which expects one of a fixed set of string values). validateTarget throws this unsupported error before sending the invalid value to the agent.","triggerScenarios":"configureACPPermissionMode resolves to a config target { configId, value: true|false } while configOption.type is 'select' (i.e. not boolean), so the code requires typeof value === 'string'.","commonSituations":"Mapping reused across agents where an option changed from boolean to a select with 'on'/'off' choices; authoring a mapping from a boolean example against a select-based agent.","solutions":["Change the mapping value to one of the select option's allowed string values.","Check the agent's advertised configOptions/options to see the valid choices.","If the option should be boolean, correct the agent or the configId in the mapping."],"exampleFix":"// before\n{ type: 'config', configId: 'approval', value: true }\n// after\n{ type: 'config', configId: 'approval', value: 'auto-approve' }","handlingStrategy":"validation","validationCode":"const opt = sessionConfiguration.configOptions?.find(o => o.id === target.configId);\nif (opt && opt.type !== 'boolean' && typeof target.value !== 'string') {\n  throw new Error(`config ${target.configId} (select) expects a string value`);\n}","typeGuard":"const isSelectConfigValue = (opt: ConfigOption | undefined, value: unknown): value is string =>\n  opt != null && opt.type !== 'boolean' && typeof value === 'string';","tryCatchPattern":null,"preventionTips":["Only use boolean values for options explicitly typed 'boolean'.","Consult the agent's advertised option choices when authoring mappings.","Add a unit test validating every mapping against a fixture session configuration."],"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"}