From 20c0ebe9277ba741107e686672ccbd6ba51d4a4f Mon Sep 17 00:00:00 2001 From: "vs-code-engineering[bot]" <122617954+vs-code-engineering[bot]@users.noreply.github.com> Date: Fri, 17 Jul 2026 15:01:19 +0000 Subject: [PATCH] fix: mark Language model unavailable as expected chat error --- src/vs/workbench/api/common/extHostChatAgents2.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/vs/workbench/api/common/extHostChatAgents2.ts b/src/vs/workbench/api/common/extHostChatAgents2.ts index a580f8cbc061b..558db5cfb26ad 100644 --- a/src/vs/workbench/api/common/extHostChatAgents2.ts +++ b/src/vs/workbench/api/common/extHostChatAgents2.ts @@ -946,7 +946,13 @@ export class ExtHostChatAgents2 extends Disposable implements ExtHostChatAgentsS if (!model) { model = await this._languageModels.getDefaultLanguageModel(extension); if (!model) { - throw new Error('Language model unavailable'); + // No language model is available (e.g. the user is not signed in or no models + // have been contributed). This is an expected operational condition, not a bug, + // so mark it as a `ChatExpectedError` to keep it out of `chatAgentError` telemetry + // while still surfacing the user-facing message. + const error = new Error('Language model unavailable'); + error.name = 'ChatExpectedError'; + throw error; } }