microsoft/vscode · error · Error
LanguageModelChatToolMode.Required is not supported with mor
Error message
LanguageModelChatToolMode.Required is not supported with more than one tool
What it means
Error "LanguageModelChatToolMode.Required is not supported with more than one tool" thrown in microsoft/vscode.
Source
Thrown at extensions/copilot/src/extension/conversation/vscode-node/languageModelAccess.ts:801
}
});
const options: OptionalChatRequestParams = LanguageModelOptions.Default.convert(_options.modelOptions ?? {});
const telemetryProperties = { messageSource: `api.${extensionId}` };
options.tools = _options.tools?.map((tool): OpenAiFunctionTool => {
return {
type: 'function',
function: {
name: tool.name,
description: tool.description,
parameters: tool.inputSchema && Object.keys(tool.inputSchema).length ? tool.inputSchema : undefined
}
};
});
if (_options.toolMode === vscode.LanguageModelChatToolMode.Required && _options.tools?.length && _options.tools.length > 1) {
throw new Error('LanguageModelChatToolMode.Required is not supported with more than one tool');
}
options.tool_choice = _options.toolMode === vscode.LanguageModelChatToolMode.Required && _options.tools?.length ?
{ type: 'function', function: { name: _options.tools[0].name } } :
undefined;
// Restore CapturingToken context if correlation ID was passed through modelOptions.
// This handles BYOK providers where the original AsyncLocalStorage context was lost
// when crossing the VS Code IPC boundary.
const correlationId = (_options as { modelOptions?: OTelModelOptions }).modelOptions?._capturingTokenCorrelationId;
const capturingToken = correlationId ? retrieveCapturingTokenByCorrelation(correlationId) : undefined;
// Restore OTel trace context if passed through modelOptions.
// This links the wrapper's chat span back to the original invoke_agent trace.
const parentTraceContext = (_options as { modelOptions?: OTelModelOptions }).modelOptions?._otelTraceContext ?? undefined;
const makeRequest = () => endpoint.makeChatRequest2({
debugName: 'copilotLanguageModelWrapper',View on GitHub (pinned to a94b963a32)
When it happens
Trigger: Thrown at extensions/copilot/src/extension/conversation/vscode-node/languageModelAccess.ts:801 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of microsoft/vscode@a94b963a32 (2026-08-12).
Data as JSON: /api/errors/5883ccf45be38e32.
Report an issue: GitHub.