From 2664dcbe2316cb4ad5595198433e1bb8b6aecace Mon Sep 17 00:00:00 2001 From: Logan Ramos Date: Fri, 15 May 2026 16:33:13 -0400 Subject: [PATCH] Revert "Fix UBB model details in Copilot CLI (#316452)" This reverts commit a1803b2a0c88b4a22ff83262b132cca1befc0886. --- extensions/copilot/package-lock.json | 56 ++++++++--------- extensions/copilot/package.json | 2 +- .../copilotcli/node/copilotCli.ts | 61 ++++--------------- .../test/copilotCLISDKUpgrade.spec.ts | 60 ++---------------- .../browser/widget/input/chatModelPicker.ts | 18 ++---- 5 files changed, 52 insertions(+), 145 deletions(-) diff --git a/extensions/copilot/package-lock.json b/extensions/copilot/package-lock.json index ed5843d8bb7a4..87782713621d6 100644 --- a/extensions/copilot/package-lock.json +++ b/extensions/copilot/package-lock.json @@ -13,7 +13,7 @@ "@anthropic-ai/claude-agent-sdk": "0.2.112", "@anthropic-ai/sdk": "^0.82.0", "@github/blackbird-external-ingest-utils": "^0.3.0", - "@github/copilot": "1.0.48", + "@github/copilot": "1.0.39", "@google/genai": "^1.22.0", "@humanwhocodes/gitignore-to-minimatch": "1.0.2", "@microsoft/tiktokenizer": "^1.0.10", @@ -2931,26 +2931,26 @@ "license": "MIT" }, "node_modules/@github/copilot": { - "version": "1.0.48", - "resolved": "https://registry.npmjs.org/@github/copilot/-/copilot-1.0.48.tgz", - "integrity": "sha512-U5SzyTEq376UU9A4Sd3TEKz+Y2nRUd90cLO4Hc1otaB8yFSy9Ur2UVGcI2/wCoodL3a39k6WbdgNzFxr0gWFRQ==", + "version": "1.0.39", + "resolved": "https://registry.npmjs.org/@github/copilot/-/copilot-1.0.39.tgz", + "integrity": "sha512-AY0VPYf6QQm88wUcOav2B36iedWKBUaMegKRxxY2uIHESiU6HueEuQR/n7D3U2UdD0zLox3jFRjYbZAsr2CgkQ==", "license": "SEE LICENSE IN LICENSE.md", "bin": { "copilot": "npm-loader.js" }, "optionalDependencies": { - "@github/copilot-darwin-arm64": "1.0.48", - "@github/copilot-darwin-x64": "1.0.48", - "@github/copilot-linux-arm64": "1.0.48", - "@github/copilot-linux-x64": "1.0.48", - "@github/copilot-win32-arm64": "1.0.48", - "@github/copilot-win32-x64": "1.0.48" + "@github/copilot-darwin-arm64": "1.0.39", + "@github/copilot-darwin-x64": "1.0.39", + "@github/copilot-linux-arm64": "1.0.39", + "@github/copilot-linux-x64": "1.0.39", + "@github/copilot-win32-arm64": "1.0.39", + "@github/copilot-win32-x64": "1.0.39" } }, "node_modules/@github/copilot-darwin-arm64": { - "version": "1.0.48", - "resolved": "https://registry.npmjs.org/@github/copilot-darwin-arm64/-/copilot-darwin-arm64-1.0.48.tgz", - "integrity": "sha512-82MLoMQwPVVFM8EYssihFxSEPUYtZADE8rMzQ3jG9HgRg2qjQSfnHQS1mKe64dlXswZUK/onw6/8kjnW5I4pPg==", + "version": "1.0.39", + "resolved": "https://registry.npmjs.org/@github/copilot-darwin-arm64/-/copilot-darwin-arm64-1.0.39.tgz", + "integrity": "sha512-E8WfNL43NMzMTDDpCiYikaEmYCMAr6mz8LHrJtkaFuVXVkBr/q2NI3hAtwHFy8M11Fac/MeIe3/VEymWwwh3kw==", "cpu": [ "arm64" ], @@ -2964,9 +2964,9 @@ } }, "node_modules/@github/copilot-darwin-x64": { - "version": "1.0.48", - "resolved": "https://registry.npmjs.org/@github/copilot-darwin-x64/-/copilot-darwin-x64-1.0.48.tgz", - "integrity": "sha512-1VQ5r5F0h8GwboXmZTcutqcJT+iCpPXAF27QqodmpKEvW9aYfG8g9X2kFJOzDZoX+SA3Uaka9qXdYKF2xT6Uog==", + "version": "1.0.39", + "resolved": "https://registry.npmjs.org/@github/copilot-darwin-x64/-/copilot-darwin-x64-1.0.39.tgz", + "integrity": "sha512-0zbC4lDVX7l8Wvq+JSCMjO0xTN69nWLejTBCl3Ev5bP6P+/7wPURcUvZKoHEaXxOULQ3AGj0DwZNAsvvQkA/6Q==", "cpu": [ "x64" ], @@ -2980,9 +2980,9 @@ } }, "node_modules/@github/copilot-linux-arm64": { - "version": "1.0.48", - "resolved": "https://registry.npmjs.org/@github/copilot-linux-arm64/-/copilot-linux-arm64-1.0.48.tgz", - "integrity": "sha512-PmsGnb0DZlI+Bf53l9HM1PAHHkUcMyB4y8v/7tnC/jDOV5dGF124n0HnDNfJLOLiJGiQGodthIif6QtPaAxpeA==", + "version": "1.0.39", + "resolved": "https://registry.npmjs.org/@github/copilot-linux-arm64/-/copilot-linux-arm64-1.0.39.tgz", + "integrity": "sha512-x88FuByweJlHlAmUZXjq4JlmtqgoM57Fe7nXzQkGr2Y5wnc2EDydBzFYEOlYDSWozQreimaJIm0KEMAA5T8/Fg==", "cpu": [ "arm64" ], @@ -2996,9 +2996,9 @@ } }, "node_modules/@github/copilot-linux-x64": { - "version": "1.0.48", - "resolved": "https://registry.npmjs.org/@github/copilot-linux-x64/-/copilot-linux-x64-1.0.48.tgz", - "integrity": "sha512-b2cc4euSlke9fYHXXsS2EL9UYbctN0h4lZvtAcKUDY+RCnpYAQOVBZK+c1R9dQrtsT6Z/yUv7PuFPSs8qdtc2Q==", + "version": "1.0.39", + "resolved": "https://registry.npmjs.org/@github/copilot-linux-x64/-/copilot-linux-x64-1.0.39.tgz", + "integrity": "sha512-ssahg8r7a0VCsHVXPRmFFXx70xNAxaTM2SZfG7qPRfFB2OM8gHrW26F2oikTklDF6D+A2MfSAMpzJLBUZbPnhw==", "cpu": [ "x64" ], @@ -3012,9 +3012,9 @@ } }, "node_modules/@github/copilot-win32-arm64": { - "version": "1.0.48", - "resolved": "https://registry.npmjs.org/@github/copilot-win32-arm64/-/copilot-win32-arm64-1.0.48.tgz", - "integrity": "sha512-VEEOwddtpJ3DTbXGhnK6K8im4ofl9m08q1m/K++sNvWV8wkkOSOQBTiPdyUsuU/TXAoFhb8tZMIJv+6NnMBtMw==", + "version": "1.0.39", + "resolved": "https://registry.npmjs.org/@github/copilot-win32-arm64/-/copilot-win32-arm64-1.0.39.tgz", + "integrity": "sha512-hhBWGZQIywbp6MBxlqMX2GSmHqtUAOGwpo9b0igscecL4i0kz89QNasC+mKiN+zFEHP6I8gggOu87XPI17Io8Q==", "cpu": [ "arm64" ], @@ -3028,9 +3028,9 @@ } }, "node_modules/@github/copilot-win32-x64": { - "version": "1.0.48", - "resolved": "https://registry.npmjs.org/@github/copilot-win32-x64/-/copilot-win32-x64-1.0.48.tgz", - "integrity": "sha512-93BzvXLPHTyy1gWBXQY/IWIHor4IAwZuuo7/obG80/Qa6U0WeaN9slz/FBJvrsgVNrrRfEID5Xm3At+S6Kj67Q==", + "version": "1.0.39", + "resolved": "https://registry.npmjs.org/@github/copilot-win32-x64/-/copilot-win32-x64-1.0.39.tgz", + "integrity": "sha512-0ehlMtBiwKjmfEY3hVZggdn7qrmPMC8ueBQv/b+6UY3SMRS/M/1Y7xkOCwG84NvJsktdSsk3SlQnE2LbkTVpSA==", "cpu": [ "x64" ], diff --git a/extensions/copilot/package.json b/extensions/copilot/package.json index 0e0c549d56bd5..b3a6a34f54969 100644 --- a/extensions/copilot/package.json +++ b/extensions/copilot/package.json @@ -6847,7 +6847,7 @@ "@anthropic-ai/claude-agent-sdk": "0.2.112", "@anthropic-ai/sdk": "^0.82.0", "@github/blackbird-external-ingest-utils": "^0.3.0", - "@github/copilot": "1.0.48", + "@github/copilot": "1.0.39", "@google/genai": "^1.22.0", "@humanwhocodes/gitignore-to-minimatch": "1.0.2", "@microsoft/tiktokenizer": "^1.0.10", diff --git a/extensions/copilot/src/extension/chatSessions/copilotcli/node/copilotCli.ts b/extensions/copilot/src/extension/chatSessions/copilotcli/node/copilotCli.ts index 76faf3fda1542..4d7180a7988de 100644 --- a/extensions/copilot/src/extension/chatSessions/copilotcli/node/copilotCli.ts +++ b/extensions/copilot/src/extension/chatSessions/copilotcli/node/copilotCli.ts @@ -43,10 +43,6 @@ export interface CopilotCLIModelInfo { readonly id: string; readonly name: string; readonly multiplier?: number; - readonly priceCategory?: string; - readonly inputCost?: number; - readonly outputCost?: number; - readonly cacheCost?: number; readonly maxInputTokens?: number; readonly maxOutputTokens?: number; readonly maxContextWindowTokens: number; @@ -156,26 +152,18 @@ export class CopilotCLIModels extends Disposable implements ICopilotCLIModels { const [{ getAvailableModels }, authInfo] = await Promise.all([this.copilotCLISDK.getPackage(), this.copilotCLISDK.getAuthInfo()]); try { const models = await getAvailableModels(authInfo); - return models.map(model => { - const tokenPrices = model.billing?.token_prices; - const normalizedPricing = normalizeTokenPricing(tokenPrices); - return { - id: model.id, - name: model.name, - multiplier: model.billing?.multiplier, - priceCategory: model.model_picker_price_category, - inputCost: normalizedPricing?.inputPrice, - outputCost: normalizedPricing?.outputPrice, - cacheCost: normalizedPricing?.cachePrice, - maxInputTokens: model.capabilities.limits.max_prompt_tokens, - maxOutputTokens: model.capabilities.limits.max_output_tokens, - maxContextWindowTokens: model.capabilities.limits.max_context_window_tokens, - supportsVision: model.capabilities.supports.vision, - supportsReasoningEffort: model.capabilities.supports.reasoningEffort, - defaultReasoningEffort: model.defaultReasoningEffort, - supportedReasoningEfforts: model.supportedReasoningEfforts, - } satisfies CopilotCLIModelInfo; - }); + return models.map(model => ({ + id: model.id, + name: model.name, + multiplier: model.billing?.multiplier, + maxInputTokens: model.capabilities.limits.max_prompt_tokens, + maxOutputTokens: model.capabilities.limits.max_output_tokens, + maxContextWindowTokens: model.capabilities.limits.max_context_window_tokens, + supportsVision: model.capabilities.supports.vision, + supportsReasoningEffort: model.capabilities.supports.reasoningEffort, + defaultReasoningEffort: model.defaultReasoningEffort, + supportedReasoningEfforts: model.supportedReasoningEfforts, + } satisfies CopilotCLIModelInfo)); } catch (ex) { this.logService.error(`[CopilotCLISession] Failed to fetch models`, ex); return []; @@ -217,10 +205,6 @@ export class CopilotCLIModels extends Disposable implements ICopilotCLIModels { maxInputTokens: model.maxInputTokens ?? model.maxContextWindowTokens, maxOutputTokens: model.maxOutputTokens ?? 0, pricing: multiplier, - priceCategory: model.priceCategory, - inputCost: model.inputCost, - outputCost: model.outputCost, - cacheCost: model.cacheCost, multiplierNumeric: model.multiplier, isUserSelectable: true, configurationSchema: isReasoningEffortEnabled ? buildConfigurationSchema(model) : undefined, @@ -617,24 +601,3 @@ export function isEnabledForCopilotCLI(customization: { sessionTypes?: readonly return sessionTypes === undefined || sessionTypes.includes('copilotcli') || false; } -const AIC_DIVISOR = 1_000_000_000; -const TOKENS_PER_MILLION = 1_000_000; - -/** - * Converts raw billing token prices (nano-AICs with a batch_size) into - * normalized AICs per million tokens, matching the normalization in - * chatEndpoint.ts for non-CLI models. - */ -function normalizeTokenPricing(tokenPrices: { input_price?: number; output_price?: number; cache_price?: number; batch_size?: number } | undefined): { inputPrice: number; outputPrice: number; cachePrice: number | undefined } | undefined { - if (!tokenPrices || tokenPrices.input_price === undefined || tokenPrices.output_price === undefined) { - return undefined; - } - const batchSize = tokenPrices.batch_size ?? TOKENS_PER_MILLION; - const scale = TOKENS_PER_MILLION / batchSize; - return { - inputPrice: (tokenPrices.input_price / AIC_DIVISOR) * scale, - outputPrice: (tokenPrices.output_price / AIC_DIVISOR) * scale, - cachePrice: tokenPrices.cache_price !== undefined ? (tokenPrices.cache_price / AIC_DIVISOR) * scale : undefined, - }; -} - diff --git a/extensions/copilot/src/extension/chatSessions/copilotcli/vscode-node/test/copilotCLISDKUpgrade.spec.ts b/extensions/copilot/src/extension/chatSessions/copilotcli/vscode-node/test/copilotCLISDKUpgrade.spec.ts index de9e53b23ab59..fdb1b71292315 100644 --- a/extensions/copilot/src/extension/chatSessions/copilotcli/vscode-node/test/copilotCLISDKUpgrade.spec.ts +++ b/extensions/copilot/src/extension/chatSessions/copilotcli/vscode-node/test/copilotCLISDKUpgrade.spec.ts @@ -55,21 +55,10 @@ describe('CopilotCLI SDK Upgrade', function () { path.join('prebuilds', 'linux-x64', 'computer.node'), path.join('prebuilds', 'win32-arm64', 'computer.node'), path.join('prebuilds', 'win32-x64', 'computer.node'), - // icu-native and runtime native modules - path.join('prebuilds', 'darwin-arm64', 'icu-native.node'), - path.join('prebuilds', 'darwin-arm64', 'runtime.node'), - path.join('prebuilds', 'darwin-x64', 'icu-native.node'), - path.join('prebuilds', 'darwin-x64', 'runtime.node'), - path.join('prebuilds', 'linux-arm64', 'runtime.node'), - path.join('prebuilds', 'linux-x64', 'icu-native.node'), - path.join('prebuilds', 'linux-x64', 'runtime.node'), - path.join('prebuilds', 'win32-arm64', 'icu-native.node'), - path.join('prebuilds', 'win32-arm64', 'runtime.node'), - path.join('prebuilds', 'win32-arm64', 'win32-native.node'), - path.join('prebuilds', 'win32-x64', 'icu-native.node'), - path.join('prebuilds', 'win32-x64', 'runtime.node'), - path.join('prebuilds', 'win32-x64', 'win32-native.node'), - // Second copy of computer.node re-shipped by the @github/copilot/sdk subpackage + // win32 native module (formerly win_error_mode) + path.join('prebuilds', 'win32-arm64', 'win32.node'), + path.join('prebuilds', 'win32-x64', 'win32.node'), + // Second copy of computer.node / win32.node re-shipped by the @github/copilot/sdk subpackage // (previously hidden by a broad sdk/prebuilds/** exclusion that masked the node-pty files we used to shim in at test setup). path.join('sdk', 'prebuilds', 'darwin-arm64', 'computer.node'), path.join('sdk', 'prebuilds', 'darwin-x64', 'computer.node'), @@ -77,6 +66,8 @@ describe('CopilotCLI SDK Upgrade', function () { path.join('sdk', 'prebuilds', 'linux-x64', 'computer.node'), path.join('sdk', 'prebuilds', 'win32-arm64', 'computer.node'), path.join('sdk', 'prebuilds', 'win32-x64', 'computer.node'), + path.join('sdk', 'prebuilds', 'win32-arm64', 'win32.node'), + path.join('sdk', 'prebuilds', 'win32-x64', 'win32.node'), path.join('ripgrep', 'bin', 'darwin-arm64', 'rg'), path.join('ripgrep', 'bin', 'darwin-x64', 'rg'), path.join('ripgrep', 'bin', 'linux-x64', 'rg'), @@ -105,46 +96,10 @@ describe('CopilotCLI SDK Upgrade', function () { 'tree-sitter-rust.wasm', 'tree-sitter-typescript.wasm', 'tree-sitter-scala.wasm', - // foundry-local-sdk native bindings - path.join('foundry-local-sdk', 'node_modules', 'foundry-local-sdk', 'prebuilds', 'darwin-arm64', 'foundry_local_napi.node'), - path.join('foundry-local-sdk', 'node_modules', 'foundry-local-sdk', 'prebuilds', 'win32-x64', 'foundry_local_napi.node'), - path.join('foundry-local-sdk', 'node_modules', 'foundry-local-sdk', 'prebuilds', 'linux-x64', 'foundry_local_napi.node'), - path.join('foundry-local-sdk', 'node_modules', 'foundry-local-sdk', 'prebuilds', 'win32-arm64', 'foundry_local_napi.node'), - // pvrecorder native bindings - path.join('pvrecorder', 'node_modules', '@picovoice', 'pvrecorder-node', 'lib', 'linux', 'x86_64', 'pv_recorder.node'), - path.join('pvrecorder', 'node_modules', '@picovoice', 'pvrecorder-node', 'lib', 'mac', 'x86_64', 'pv_recorder.node'), - path.join('pvrecorder', 'node_modules', '@picovoice', 'pvrecorder-node', 'lib', 'windows', 'amd64', 'pv_recorder.node'), - path.join('pvrecorder', 'node_modules', '@picovoice', 'pvrecorder-node', 'lib', 'mac', 'arm64', 'pv_recorder.node'), - path.join('pvrecorder', 'node_modules', '@picovoice', 'pvrecorder-node', 'lib', 'windows', 'arm64', 'pv_recorder.node'), - // mxc-bin binaries (sandbox) - path.join('mxc-bin', 'arm64', 'winhttp-proxy-shim.exe'), - path.join('mxc-bin', 'arm64', 'wslcsdk.dll'), - path.join('mxc-bin', 'arm64', 'wxc-exec.exe'), - path.join('mxc-bin', 'arm64', 'wxc-test-proxy.exe'), - path.join('mxc-bin', 'arm64', 'lxc-exec'), - path.join('mxc-bin', 'arm64', 'wxc-windows-sandbox-guest.exe'), - path.join('mxc-bin', 'arm64', 'wxc-windows-sandbox-daemon.exe'), - path.join('mxc-bin', 'arm64', '_manifest', 'spdx_2.2', 'bsi.cose'), - path.join('mxc-bin', 'arm64', '_manifest', 'spdx_2.2', 'manifest.cat'), - path.join('mxc-bin', 'arm64', '_manifest', 'spdx_2.2', 'manifest.spdx.cose'), - path.join('mxc-bin', 'x64', 'winhttp-proxy-shim.exe'), - path.join('mxc-bin', 'x64', 'wslcsdk.dll'), - path.join('mxc-bin', 'x64', 'wxc-exec.exe'), - path.join('mxc-bin', 'x64', 'wxc-test-proxy.exe'), - path.join('mxc-bin', 'x64', 'lxc-exec'), - path.join('mxc-bin', 'x64', 'wxc-windows-sandbox-guest.exe'), - path.join('mxc-bin', 'x64', 'wxc-windows-sandbox-daemon.exe'), - path.join('mxc-bin', 'x64', '_manifest', 'spdx_2.2', 'bsi.cose'), - path.join('mxc-bin', 'x64', '_manifest', 'spdx_2.2', 'manifest.cat'), - path.join('mxc-bin', 'x64', '_manifest', 'spdx_2.2', 'manifest.spdx.cose'), ].map(p => path.join(copilotSDKPath, p))); // Exclude ripgrep files that we copy over in src/extension/chatSessions/copilotcli/node/ripgrepShim.ts (until we get better API/solution from SDK) const ripgrepFilesWeCopy = path.join(copilotSDKPath, 'sdk', 'ripgrep', 'bin'); - // Exclude node-pty files under sdk/prebuilds/ — these are platform-specific postinstall artifacts - // that vary per OS (pty.node/spawn-helper on macOS/Linux, conpty files on Windows). - const sdkPrebuildsPath = path.join(copilotSDKPath, 'sdk', 'prebuilds'); - const nodePtyBinaryNames = new Set(['pty.node', 'spawn-helper', 'conpty.node', 'conpty.pdb', 'conpty_console_list.node', 'conpty_console_list.pdb', 'OpenConsole.exe', 'conpty.dll']); const errors: string[] = []; // Look for new binaries @@ -156,9 +111,6 @@ describe('CopilotCLI SDK Upgrade', function () { if (binaryName.startsWith('keytar') || binaryName.startsWith('clipboard')) { continue; } - if (binary.startsWith(sdkPrebuildsPath) && nodePtyBinaryNames.has(binaryName)) { - continue; - } if (!knownBinaries.has(binary)) { errors.push(`Unexpected native binary found in Copilot CLI SDK: ${path.relative(copilotSDKPath, binary)}`); } diff --git a/src/vs/workbench/contrib/chat/browser/widget/input/chatModelPicker.ts b/src/vs/workbench/contrib/chat/browser/widget/input/chatModelPicker.ts index a1aa8bcf493e6..23225dc1a8963 100644 --- a/src/vs/workbench/contrib/chat/browser/widget/input/chatModelPicker.ts +++ b/src/vs/workbench/contrib/chat/browser/widget/input/chatModelPicker.ts @@ -253,19 +253,11 @@ function resolveConfigProperty( */ function getPriceCategoryLabel(priceCategory: string | undefined): string | undefined { switch (priceCategory) { - case undefined: - case '': - return undefined; - case 'low': - return localize('chat.priceCategory.low', "Low cost"); - case 'medium': - return localize('chat.priceCategory.medium', "Medium cost"); - case 'high': - return localize('chat.priceCategory.high', "High cost"); - case 'very_high': - return localize('chat.priceCategory.veryHigh', "Very high cost"); - default: - return localize('chat.priceCategory.unknown', "{0} cost", priceCategory.charAt(0).toUpperCase() + priceCategory.slice(1)); + case 'low': return localize('chat.priceCategory.low', "Low cost"); + case 'medium': return localize('chat.priceCategory.medium', "Medium cost"); + case 'high': return localize('chat.priceCategory.high', "High cost"); + case 'very_high': return localize('chat.priceCategory.veryHigh', "Very high cost"); + default: return undefined; } }