vercel/ai · error · UnsupportedFunctionalityError

tool choice type: ${_exhaustiveCheck}

Error message

tool choice type: ${_exhaustiveCheck}

What it means

Error "tool choice type: ${_exhaustiveCheck}" thrown in vercel/ai.

Source

Thrown at packages/cohere/src/cohere-prepare-tools.ts:91

    case 'none':
      return { tools: cohereTools, toolChoice: 'NONE', toolWarnings };

    case 'required':
      return { tools: cohereTools, toolChoice: 'REQUIRED', toolWarnings };

    case 'tool':
      return {
        tools: cohereTools.filter(
          tool => tool.function.name === toolChoice.toolName,
        ),
        toolChoice: 'REQUIRED',
        toolWarnings,
      };

    default: {
      const _exhaustiveCheck: never = type;
      throw new UnsupportedFunctionalityError({
        functionality: `tool choice type: ${_exhaustiveCheck}`,
      });
    }
  }
}

View on GitHub (pinned to 69428b1f8b)

When it happens

Trigger: Thrown at packages/cohere/src/cohere-prepare-tools.ts:91 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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