{"record":{"id":"36cc2b905536ad8a","repo":"vercel/ai","slug":"acp-permission-mapping-for-json-stringify-permis-36cc2b","errorCode":null,"errorMessage":"ACP permission mapping for ${JSON.stringify(permissionMode)} requires session configuration ${JSON.stringify(target.configId)}, but the agent advertised ${formatChoices({ values: availableConfigIds })}.","messagePattern":"ACP permission mapping for (.+?) requires 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":106,"sourceCode":"    if (!availableModeIds.includes(target.modeId)) {\n      throw unsupported({\n        harnessId,\n        message:\n          `ACP permission mapping for ${JSON.stringify(permissionMode)} requires session mode ` +\n          `${JSON.stringify(target.modeId)}, but the agent advertised ` +\n          `${formatChoices({ values: availableModeIds })}.`,\n      });\n    }\n    return;\n  }\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  }","sourceCodeStart":88,"sourceCodeEnd":124,"githubUrl":"https://github.com/vercel/ai/blob/69428b1f8b037e4d118fb4853428d5c4e620493c/packages/harness-acp/src/v1/bridge/permission-mode.ts#L88-L124","documentation":"When the permission mode maps to a config-option target, validateTarget looks up the target configId in the agent-advertised sessionConfiguration.configOptions. If no config option with that id exists, the harness throws this unsupported error listing the config option ids the agent actually advertises.","triggerScenarios":"configureACPPermissionMode resolves the permissionMode to a { type: 'config', configId, value } mapping whose configId is not among sessionConfiguration.configOptions[].id.","commonSituations":"Mapping written for one ACP agent (e.g. Claude Code's config ids) reused with another agent; agent renamed config options between versions; typo in configId.","solutions":["Use a configId that appears in the agent's advertised configOptions (listed in the error).","Update the harness's permissionModeMapping for this mode to reference a valid config option id.","Log sessionConfiguration.configOptions at session start to discover valid ids dynamically."],"exampleFix":"// before\n{ type: 'config', configId: 'permission-mode', value: 'bypassPermissions' }\n// after (id the agent advertises)\n{ type: 'config', configId: 'permission_mode', value: 'bypassPermissions' }","handlingStrategy":"validation","validationCode":"const configIds = (sessionConfiguration.configOptions ?? []).map(o => o.id);\nif (!configIds.includes(target.configId)) {\n  throw new Error(`configId ${target.configId} not advertised; available: ${configIds.join(', ')}`);\n}","typeGuard":"const hasConfigOption = (configId: string, cfg: SessionConfiguration): boolean =>\n  (cfg.configOptions ?? []).some(o => o.id === configId);","tryCatchPattern":null,"preventionTips":["Enumerate configOptions dynamically rather than hard-coding ids per agent.","Keep a mapping per agent type/version.","Log advertised configOptions when a new agent is onboarded."],"tags":["acp","permissions","config-options","configuration-mismatch"],"backgroundTag":"unsupported-permission-mode","analyzedSha":"69428b1f8b037e4d118fb4853428d5c4e620493c","analyzedAt":"2026-08-30T12:32:21.016Z","schemaVersion":2},"datasetVersion":"2026-08-30T13:17:10.514Z"}