vercel/ai · error · HarnessBridgeCapabilityUnsupportedError

ACP permission mapping for ${JSON.stringify(permissionMode)}

Error message

ACP permission mapping for ${JSON.stringify(permissionMode)} assigns string value ${JSON.stringify(target.value)} to boolean session configuration ${JSON.stringify(target.configId)}.

What it means

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.

Source

Thrown at packages/harness-acp/src/v1/bridge/permission-mode.ts:116

  }

  const configOption = sessionConfiguration.configOptions?.find(
    option => option.id === target.configId,
  );
  if (configOption == null) {
    const availableConfigIds =
      sessionConfiguration.configOptions?.map(option => option.id) ?? [];
    throw unsupported({
      harnessId,
      message:
        `ACP permission mapping for ${JSON.stringify(permissionMode)} requires session configuration ` +
        `${JSON.stringify(target.configId)}, but the agent advertised ` +
        `${formatChoices({ values: availableConfigIds })}.`,
    });
  }
  if (configOption.type === 'boolean') {
    if (typeof target.value !== 'boolean') {
      throw unsupported({
        harnessId,
        message:
          `ACP permission mapping for ${JSON.stringify(permissionMode)} assigns string value ` +
          `${JSON.stringify(target.value)} to boolean session configuration ${JSON.stringify(target.configId)}.`,
      });
    }
    return;
  }
  if (typeof target.value !== 'string') {
    throw unsupported({
      harnessId,
      message:
        `ACP permission mapping for ${JSON.stringify(permissionMode)} assigns boolean value ` +
        `${JSON.stringify(target.value)} to select session configuration ${JSON.stringify(target.configId)}.`,
    });
  }
  const availableValues = configOption.options.flatMap(option =>
    'options' in option

View on GitHub (pinned to 69428b1f8b)

Solutions

  1. Change the mapping value to a real boolean (true/false) for this boolean config option.
  2. If the option is genuinely string-valued, update the mapping against the correct agent config type.
  3. Inspect configOptions in the session/update payload to confirm each option's type before writing mappings.

Example fix

// before
{ type: 'config', configId: 'autoApprove', value: 'true' }
// after
{ type: 'config', configId: 'autoApprove', value: true }
Defensive patterns

Strategy: validation

Validate before calling

const opt = sessionConfiguration.configOptions?.find(o => o.id === target.configId);
if (opt?.type === 'boolean' && typeof target.value !== 'boolean') {
  throw new Error(`config ${target.configId} expects a boolean`);
}

Type guard

const isBooleanConfigValue = (opt: ConfigOption | undefined, value: unknown): value is boolean =>
  opt?.type === 'boolean' && typeof value === 'boolean';

Prevention

When it happens

Trigger: configureACPPermissionMode resolves to a config target { configId, value: '<some string>' } while the matching configOption.type === 'boolean'.

Common situations: 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.

Related errors


AI-assisted analysis of vercel/ai@69428b1f8b (2026-08-30). Data as JSON: /api/errors/07633c0e3748f43f. Report an issue: GitHub.