vercel/ai · error · HarnessBridgeCapabilityUnsupportedError

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

Error message

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 })}.

What it means

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.

Source

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

      });
    }
    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
      ? option.options.map(value => value.value)
      : [option.value],
  );
  if (!availableValues.includes(target.value)) {
    throw unsupported({
      harnessId,
      message:
        `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 })}.`,
    });
  }
}

function formatChoices({ values }: { values: ReadonlyArray<string> }): string {
  return values.length === 0
    ? 'no matching choices'
    : values.map(value => JSON.stringify(value)).join(', ');
}

function unsupported({
  harnessId,
  message,

View on GitHub (pinned to 69428b1f8b)

Solutions

  1. Set the mapping value to one of the advertised values listed in the error message.
  2. Update the permissionModeMapping after checking the agent's current config option choices.
  3. If the needed value isn't offered at all, choose a different permissionMode or request the value from the agent maintainers.

Example fix

// before
{ type: 'config', configId: 'approval', value: 'yolo' }
// after
{ type: 'config', configId: 'approval', value: 'bypass-all' }
Defensive patterns

Strategy: validation

Validate before calling

const values = (opt.options ?? []).flatMap(o => 'options' in o ? o.options.map(v => v.value) : [o.value]);
if (!values.includes(target.value)) {
  throw new Error(`value ${target.value} not offered; available: ${values.join(', ')}`);
}

Type guard

const isAdvertisedValue = (opt: ConfigOption, value: string): boolean =>
  (opt.options ?? []).flatMap(o => 'options' in o ? o.options.map(v => v.value) : [o.value]).includes(value);

Prevention

When it happens

Trigger: configureACPPermissionMode resolves to a config target whose string value is not contained in the flattened availableValues of the matching select configOption.

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

Related errors


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