diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 048141704e..dd1bada909 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -880,8 +880,8 @@ importers: specifier: ^5.0.5 version: 5.0.5 '@types/vscode': - specifier: ^1.84.0 - version: 1.100.0 + specifier: ^1.104.0 + version: 1.104.0 '@vscode/test-electron': specifier: ^2.5.2 version: 2.5.2 @@ -4136,6 +4136,9 @@ packages: '@types/vscode@1.103.0': resolution: {integrity: sha512-o4hanZAQdNfsKecexq9L3eHICd0AAvdbLk6hA60UzGXbGH/q8b/9xv2RgR7vV3ZcHuyKVq7b37IGd/+gM4Tu+Q==} + '@types/vscode@1.104.0': + resolution: {integrity: sha512-0KwoU2rZ2ecsTGFxo4K1+f+AErRsYW0fsp6A0zufzGuhyczc2IoKqYqcwXidKXmy2u8YB2GsYsOtiI9Izx3Tig==} + '@types/ws@8.18.1': resolution: {integrity: sha512-ThVF6DCVhA8kUGy+aazFQ4kXQ7E1Ty7A3ypFOe0IcJV8O/M511G99AW24irKrW56Wt44yG9+ij8FaqoBGkuBXg==} @@ -13667,6 +13670,8 @@ snapshots: '@types/vscode@1.103.0': {} + '@types/vscode@1.104.0': {} + '@types/ws@8.18.1': dependencies: '@types/node': 24.2.1 @@ -13842,7 +13847,7 @@ snapshots: sirv: 3.0.1 tinyglobby: 0.2.14 tinyrainbow: 2.0.0 - vitest: 3.2.4(@types/debug@4.1.12)(@types/node@20.17.57)(@vitest/ui@3.2.4)(jiti@2.4.2)(jsdom@26.1.0)(lightningcss@1.30.1)(tsx@4.19.4)(yaml@2.8.0) + vitest: 3.2.4(@types/debug@4.1.12)(@types/node@20.17.50)(@vitest/ui@3.2.4)(jiti@2.4.2)(jsdom@26.1.0)(lightningcss@1.30.1)(tsx@4.19.4)(yaml@2.8.0) '@vitest/utils@3.2.4': dependencies: diff --git a/src/api/providers/vscode-lm.ts b/src/api/providers/vscode-lm.ts index d8a492f772..46f13cf9fa 100644 --- a/src/api/providers/vscode-lm.ts +++ b/src/api/providers/vscode-lm.ts @@ -510,7 +510,10 @@ export class VsCodeLmHandler extends BaseProvider implements SingleCompletionHan typeof this.client.maxInputTokens === "number" ? Math.max(0, this.client.maxInputTokens) : openAiModelInfoSaneDefaults.contextWindow, - supportsImages: false, // VSCode Language Model API currently doesn't support image inputs + // TODO: Enable image support when VS Code LM API provides capability detection + // The newer VS Code API (1.95+) includes LanguageModelChatInformation.capabilities.imageInput + // but it's not directly accessible from the LanguageModelChat interface yet + supportsImages: false, supportsPromptCache: true, inputPrice: 0, outputPrice: 0, diff --git a/src/api/transform/__tests__/vscode-lm-format.spec.ts b/src/api/transform/__tests__/vscode-lm-format.spec.ts index 1f53cc5751..4fa5906912 100644 --- a/src/api/transform/__tests__/vscode-lm-format.spec.ts +++ b/src/api/transform/__tests__/vscode-lm-format.spec.ts @@ -170,7 +170,9 @@ describe("convertToVsCodeLmMessages", () => { expect(result).toHaveLength(1) const imagePlaceholder = result[0].content[1] as MockLanguageModelTextPart - expect(imagePlaceholder.value).toContain("[Image (base64): image/png not supported by VSCode LM API]") + expect(imagePlaceholder.value).toContain( + "[Image placeholder: base64 (image/png) - VS Code LM API image support pending]", + ) }) }) diff --git a/src/api/transform/vscode-lm-format.ts b/src/api/transform/vscode-lm-format.ts index 58b85f19a9..3343d73b5e 100644 --- a/src/api/transform/vscode-lm-format.ts +++ b/src/api/transform/vscode-lm-format.ts @@ -85,8 +85,12 @@ export function convertToVsCodeLmMessages( // Convert non-tool messages to TextParts after tool messages ...nonToolMessages.map((part) => { if (part.type === "image") { + // TODO: When VS Code LM API adds LanguageModelImagePart support, convert images properly + // For now, we provide a placeholder text description + const imageType = part.source?.type || "unknown" + const mediaType = part.source?.media_type || "unknown" return new vscode.LanguageModelTextPart( - `[Image (${part.source?.type || "Unknown source-type"}): ${part.source?.media_type || "unknown media-type"} not supported by VSCode LM API]`, + `[Image placeholder: ${imageType} (${mediaType}) - VS Code LM API image support pending]`, ) } return new vscode.LanguageModelTextPart(part.text) @@ -129,7 +133,10 @@ export function convertToVsCodeLmMessages( // Convert non-tool messages to TextParts after tool messages ...nonToolMessages.map((part) => { if (part.type === "image") { - return new vscode.LanguageModelTextPart("[Image generation not supported by VSCode LM API]") + // Assistant-generated images are not yet supported + return new vscode.LanguageModelTextPart( + "[Image generation not yet supported by VS Code LM API]", + ) } return new vscode.LanguageModelTextPart(part.text) }), diff --git a/src/package.json b/src/package.json index 4016b06f22..b26d7d1843 100644 --- a/src/package.json +++ b/src/package.json @@ -10,7 +10,7 @@ "theme": "dark" }, "engines": { - "vscode": "^1.84.0", + "vscode": "^1.95.0", "node": "20.19.2" }, "author": { @@ -531,7 +531,7 @@ "@types/string-similarity": "^4.0.2", "@types/tmp": "^0.2.6", "@types/turndown": "^5.0.5", - "@types/vscode": "^1.84.0", + "@types/vscode": "^1.104.0", "@vscode/test-electron": "^2.5.2", "@vscode/vsce": "3.3.2", "esbuild": "^0.25.0",