diff --git a/package-lock.json b/package-lock.json index d3044e0bc7d383..b2cff2ad760877 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,7 +12,7 @@ "dependencies": { "@anthropic-ai/sdk": "^0.82.0", "@devcontainers/cli": "0.88.0", - "@github/copilot-sdk": "1.0.17-preview.4", + "@github/copilot-sdk": "1.0.17-preview.5", "@microsoft/1ds-core-js": "^3.2.13", "@microsoft/1ds-post-js": "^3.2.13", "@microsoft/dev-tunnels-connections": "^1.3.41", @@ -1170,9 +1170,9 @@ } }, "node_modules/@github/copilot-sdk": { - "version": "1.0.17-preview.4", - "resolved": "https://registry.npmjs.org/@github/copilot-sdk/-/copilot-sdk-1.0.17-preview.4.tgz", - "integrity": "sha512-tt5pyDLUjiaxJSMCU2HRDLRSFOA4mIFpI6+360EC0jqNDmhlaeJy88YwO6zDO77D21l8lGt8INBj+IYMbPb30Q==", + "version": "1.0.17-preview.5", + "resolved": "https://registry.npmjs.org/@github/copilot-sdk/-/copilot-sdk-1.0.17-preview.5.tgz", + "integrity": "sha512-Nj/SaURylTh5PqyONpEd0JHc7C1s+/cSPvhKf1ZST+Yn+91exkmQSKuZjABuACxQhtJ/vbQ6QbmiXPx/6S3gyg==", "license": "MIT", "dependencies": { "koffi": "3.2.1", @@ -1183,20 +1183,20 @@ "node": "^20.19.0 || >=22.12.0" }, "optionalDependencies": { - "@github/copilot-sdk-darwin-arm64": "1.0.17-preview.4", - "@github/copilot-sdk-darwin-x64": "1.0.17-preview.4", - "@github/copilot-sdk-linux-arm64": "1.0.17-preview.4", - "@github/copilot-sdk-linux-x64": "1.0.17-preview.4", - "@github/copilot-sdk-linuxmusl-arm64": "1.0.17-preview.4", - "@github/copilot-sdk-linuxmusl-x64": "1.0.17-preview.4", - "@github/copilot-sdk-win32-arm64": "1.0.17-preview.4", - "@github/copilot-sdk-win32-x64": "1.0.17-preview.4" + "@github/copilot-sdk-darwin-arm64": "1.0.17-preview.5", + "@github/copilot-sdk-darwin-x64": "1.0.17-preview.5", + "@github/copilot-sdk-linux-arm64": "1.0.17-preview.5", + "@github/copilot-sdk-linux-x64": "1.0.17-preview.5", + "@github/copilot-sdk-linuxmusl-arm64": "1.0.17-preview.5", + "@github/copilot-sdk-linuxmusl-x64": "1.0.17-preview.5", + "@github/copilot-sdk-win32-arm64": "1.0.17-preview.5", + "@github/copilot-sdk-win32-x64": "1.0.17-preview.5" } }, "node_modules/@github/copilot-sdk-darwin-arm64": { - "version": "1.0.17-preview.4", - "resolved": "https://registry.npmjs.org/@github/copilot-sdk-darwin-arm64/-/copilot-sdk-darwin-arm64-1.0.17-preview.4.tgz", - "integrity": "sha512-cufab0CWxFH0wwIw1/dlPNx4gFP/PJoL4+tUQ/d6lZ+SWX4/2VQgRJCQ97qe9Nqql3YWDikiJTTHXQ55xkmmRA==", + "version": "1.0.17-preview.5", + "resolved": "https://registry.npmjs.org/@github/copilot-sdk-darwin-arm64/-/copilot-sdk-darwin-arm64-1.0.17-preview.5.tgz", + "integrity": "sha512-VNwE78kymAK142c4vkZDYJBbB38GZag29sw2MAC42pQyMkf/a61gunH9k4FECgFnOTRCW1k0ouUJmqBkHwsgTw==", "cpu": [ "arm64" ], @@ -1207,9 +1207,9 @@ ] }, "node_modules/@github/copilot-sdk-darwin-x64": { - "version": "1.0.17-preview.4", - "resolved": "https://registry.npmjs.org/@github/copilot-sdk-darwin-x64/-/copilot-sdk-darwin-x64-1.0.17-preview.4.tgz", - "integrity": "sha512-4kj7nU3oXCFFm24d6FijBkuiLTCBtfiI8qEHsDcSxfgPdPnwV+9osT/EAZRKPTh3DYGwqTO7i+bIHEHgogd+Wg==", + "version": "1.0.17-preview.5", + "resolved": "https://registry.npmjs.org/@github/copilot-sdk-darwin-x64/-/copilot-sdk-darwin-x64-1.0.17-preview.5.tgz", + "integrity": "sha512-XiM1G9k91AF+F6L5PvcQ6LFhFyN+Vo5o93cgY8rmUXP7sWUDBZljy84VL/wsPBjBoKBZj33utyZedHIU/2IfoA==", "cpu": [ "x64" ], @@ -1220,9 +1220,9 @@ ] }, "node_modules/@github/copilot-sdk-linux-arm64": { - "version": "1.0.17-preview.4", - "resolved": "https://registry.npmjs.org/@github/copilot-sdk-linux-arm64/-/copilot-sdk-linux-arm64-1.0.17-preview.4.tgz", - "integrity": "sha512-aOHcV5YiFGhtxh+H3qhOuMzktyhwuepGl/jWkWu2vTLy2oztpMnxmoRgwJaj9NdNQoiM8PO13YjbFhbb3TGaOA==", + "version": "1.0.17-preview.5", + "resolved": "https://registry.npmjs.org/@github/copilot-sdk-linux-arm64/-/copilot-sdk-linux-arm64-1.0.17-preview.5.tgz", + "integrity": "sha512-tDiZnlFfwNYqh2yoqpnRRJjvO47EInrIXn6vMsIMXAO3sAXckSyitP10qWQkOEbhgVjVczwsLE/df64356CyOg==", "cpu": [ "arm64" ], @@ -1236,9 +1236,9 @@ ] }, "node_modules/@github/copilot-sdk-linux-x64": { - "version": "1.0.17-preview.4", - "resolved": "https://registry.npmjs.org/@github/copilot-sdk-linux-x64/-/copilot-sdk-linux-x64-1.0.17-preview.4.tgz", - "integrity": "sha512-W98/SrLJXVk5xn8GgvUxNs8wHM10nPe5Ff3fU9vKb4Kb0aS2KyxoAhC4eoNn8VRB2XDW2wFTBvUJAutCiWGL+Q==", + "version": "1.0.17-preview.5", + "resolved": "https://registry.npmjs.org/@github/copilot-sdk-linux-x64/-/copilot-sdk-linux-x64-1.0.17-preview.5.tgz", + "integrity": "sha512-eYOibqL5OmI1ulyUcA76gGswzzHXp4Rmvwg4mYGUTFDql9eNy976ASaEwgQTie1FS5gQUKNeiAiLRF9hsrsVHw==", "cpu": [ "x64" ], @@ -1252,9 +1252,9 @@ ] }, "node_modules/@github/copilot-sdk-linuxmusl-arm64": { - "version": "1.0.17-preview.4", - "resolved": "https://registry.npmjs.org/@github/copilot-sdk-linuxmusl-arm64/-/copilot-sdk-linuxmusl-arm64-1.0.17-preview.4.tgz", - "integrity": "sha512-hym02Fv/JuqjmmMqs4E+XFEgx8nzIpIdMLSr5CFpMLWVVKQYBhY8x6r+03qXhfutUWlcoL5f8gK/pdOR23k9jw==", + "version": "1.0.17-preview.5", + "resolved": "https://registry.npmjs.org/@github/copilot-sdk-linuxmusl-arm64/-/copilot-sdk-linuxmusl-arm64-1.0.17-preview.5.tgz", + "integrity": "sha512-ePJQJg3ohITIQhU35MTSnxKLxweDhaFitohRusO7G5Z4pkfntWgcKdv0rGOejcicDJ7dTiEqwTVSC3Ed1Oe7+g==", "cpu": [ "arm64" ], @@ -1268,9 +1268,9 @@ ] }, "node_modules/@github/copilot-sdk-linuxmusl-x64": { - "version": "1.0.17-preview.4", - "resolved": "https://registry.npmjs.org/@github/copilot-sdk-linuxmusl-x64/-/copilot-sdk-linuxmusl-x64-1.0.17-preview.4.tgz", - "integrity": "sha512-IhjdLXtUSV8lSZiWsciGHD2iwv3nS2pAwLMywfgB1GozouBDIfWZJlbTUX5Jqv4JeZjE7lpvD5e+Sc11HL6kQQ==", + "version": "1.0.17-preview.5", + "resolved": "https://registry.npmjs.org/@github/copilot-sdk-linuxmusl-x64/-/copilot-sdk-linuxmusl-x64-1.0.17-preview.5.tgz", + "integrity": "sha512-pzxYvWjSzFNiEV+hBzkRhlugGP3C7dQ8jsDYdrdWO7brE8y2/FGcuganmdQWevMPb9V7vQZEbk/SvelC48kmGw==", "cpu": [ "x64" ], @@ -1284,9 +1284,9 @@ ] }, "node_modules/@github/copilot-sdk-win32-arm64": { - "version": "1.0.17-preview.4", - "resolved": "https://registry.npmjs.org/@github/copilot-sdk-win32-arm64/-/copilot-sdk-win32-arm64-1.0.17-preview.4.tgz", - "integrity": "sha512-MxJJiT2DoDXi3a6dPY/DwMbJPweK75ywlIIbK6Agnof055euC4st3bKMUXz8Nuq4pWzXU3HEWFUVWnNr/63TNw==", + "version": "1.0.17-preview.5", + "resolved": "https://registry.npmjs.org/@github/copilot-sdk-win32-arm64/-/copilot-sdk-win32-arm64-1.0.17-preview.5.tgz", + "integrity": "sha512-H83RaEde07pgVoL978Ala7KaOAPsgNIwMdZRLB2i/BIVIEN7gpceBNVZBYw8l5a/mVGb3fO+UMhJxgUNjQfNDw==", "cpu": [ "arm64" ], @@ -1297,9 +1297,9 @@ ] }, "node_modules/@github/copilot-sdk-win32-x64": { - "version": "1.0.17-preview.4", - "resolved": "https://registry.npmjs.org/@github/copilot-sdk-win32-x64/-/copilot-sdk-win32-x64-1.0.17-preview.4.tgz", - "integrity": "sha512-NGC8k/WHw6lP6O6h/nJiw3lBaaaMjb1hu+urr+Wpa9EP9a/PFL4rWXpxixgQT4qym7EAVY+EE1vSTA8jCi7cAA==", + "version": "1.0.17-preview.5", + "resolved": "https://registry.npmjs.org/@github/copilot-sdk-win32-x64/-/copilot-sdk-win32-x64-1.0.17-preview.5.tgz", + "integrity": "sha512-AA7BQoNXZl9bbPSqyN2pDXm0Nw2cSNvviQDqU4rMXGX10Ye8RfiLXMMqIGQn8vYYhR1wY+D8/gQCDlv22HvGng==", "cpu": [ "x64" ], diff --git a/package.json b/package.json index cbabf9bd0f8784..78c5d73bff8f79 100644 --- a/package.json +++ b/package.json @@ -102,7 +102,7 @@ "dependencies": { "@anthropic-ai/sdk": "^0.82.0", "@devcontainers/cli": "0.88.0", - "@github/copilot-sdk": "1.0.17-preview.4", + "@github/copilot-sdk": "1.0.17-preview.5", "@microsoft/1ds-core-js": "^3.2.13", "@microsoft/1ds-post-js": "^3.2.13", "@microsoft/dev-tunnels-connections": "^1.3.41", @@ -325,5 +325,5 @@ "@vscode/windows-ca-certs@0.3.4": true, "@vscode/windows-process-tree@0.8.0": true }, - "copilotRuntimeVersion": "1.0.92-4" + "copilotRuntimeVersion": "1.0.92-5" } diff --git a/remote/package-lock.json b/remote/package-lock.json index 0300e36651d483..3830bb26080ae0 100644 --- a/remote/package-lock.json +++ b/remote/package-lock.json @@ -9,7 +9,7 @@ "version": "0.0.0", "dependencies": { "@devcontainers/cli": "0.88.0", - "@github/copilot-sdk": "1.0.17-preview.4", + "@github/copilot-sdk": "1.0.17-preview.5", "@microsoft/1ds-core-js": "^3.2.13", "@microsoft/1ds-post-js": "^3.2.13", "@microsoft/mxc-sdk": "0.9.0", @@ -73,9 +73,9 @@ } }, "node_modules/@github/copilot-sdk": { - "version": "1.0.17-preview.4", - "resolved": "https://registry.npmjs.org/@github/copilot-sdk/-/copilot-sdk-1.0.17-preview.4.tgz", - "integrity": "sha512-tt5pyDLUjiaxJSMCU2HRDLRSFOA4mIFpI6+360EC0jqNDmhlaeJy88YwO6zDO77D21l8lGt8INBj+IYMbPb30Q==", + "version": "1.0.17-preview.5", + "resolved": "https://registry.npmjs.org/@github/copilot-sdk/-/copilot-sdk-1.0.17-preview.5.tgz", + "integrity": "sha512-Nj/SaURylTh5PqyONpEd0JHc7C1s+/cSPvhKf1ZST+Yn+91exkmQSKuZjABuACxQhtJ/vbQ6QbmiXPx/6S3gyg==", "license": "MIT", "dependencies": { "koffi": "3.2.1", @@ -86,20 +86,20 @@ "node": "^20.19.0 || >=22.12.0" }, "optionalDependencies": { - "@github/copilot-sdk-darwin-arm64": "1.0.17-preview.4", - "@github/copilot-sdk-darwin-x64": "1.0.17-preview.4", - "@github/copilot-sdk-linux-arm64": "1.0.17-preview.4", - "@github/copilot-sdk-linux-x64": "1.0.17-preview.4", - "@github/copilot-sdk-linuxmusl-arm64": "1.0.17-preview.4", - "@github/copilot-sdk-linuxmusl-x64": "1.0.17-preview.4", - "@github/copilot-sdk-win32-arm64": "1.0.17-preview.4", - "@github/copilot-sdk-win32-x64": "1.0.17-preview.4" + "@github/copilot-sdk-darwin-arm64": "1.0.17-preview.5", + "@github/copilot-sdk-darwin-x64": "1.0.17-preview.5", + "@github/copilot-sdk-linux-arm64": "1.0.17-preview.5", + "@github/copilot-sdk-linux-x64": "1.0.17-preview.5", + "@github/copilot-sdk-linuxmusl-arm64": "1.0.17-preview.5", + "@github/copilot-sdk-linuxmusl-x64": "1.0.17-preview.5", + "@github/copilot-sdk-win32-arm64": "1.0.17-preview.5", + "@github/copilot-sdk-win32-x64": "1.0.17-preview.5" } }, "node_modules/@github/copilot-sdk-darwin-arm64": { - "version": "1.0.17-preview.4", - "resolved": "https://registry.npmjs.org/@github/copilot-sdk-darwin-arm64/-/copilot-sdk-darwin-arm64-1.0.17-preview.4.tgz", - "integrity": "sha512-cufab0CWxFH0wwIw1/dlPNx4gFP/PJoL4+tUQ/d6lZ+SWX4/2VQgRJCQ97qe9Nqql3YWDikiJTTHXQ55xkmmRA==", + "version": "1.0.17-preview.5", + "resolved": "https://registry.npmjs.org/@github/copilot-sdk-darwin-arm64/-/copilot-sdk-darwin-arm64-1.0.17-preview.5.tgz", + "integrity": "sha512-VNwE78kymAK142c4vkZDYJBbB38GZag29sw2MAC42pQyMkf/a61gunH9k4FECgFnOTRCW1k0ouUJmqBkHwsgTw==", "cpu": [ "arm64" ], @@ -110,9 +110,9 @@ ] }, "node_modules/@github/copilot-sdk-darwin-x64": { - "version": "1.0.17-preview.4", - "resolved": "https://registry.npmjs.org/@github/copilot-sdk-darwin-x64/-/copilot-sdk-darwin-x64-1.0.17-preview.4.tgz", - "integrity": "sha512-4kj7nU3oXCFFm24d6FijBkuiLTCBtfiI8qEHsDcSxfgPdPnwV+9osT/EAZRKPTh3DYGwqTO7i+bIHEHgogd+Wg==", + "version": "1.0.17-preview.5", + "resolved": "https://registry.npmjs.org/@github/copilot-sdk-darwin-x64/-/copilot-sdk-darwin-x64-1.0.17-preview.5.tgz", + "integrity": "sha512-XiM1G9k91AF+F6L5PvcQ6LFhFyN+Vo5o93cgY8rmUXP7sWUDBZljy84VL/wsPBjBoKBZj33utyZedHIU/2IfoA==", "cpu": [ "x64" ], @@ -123,9 +123,9 @@ ] }, "node_modules/@github/copilot-sdk-linux-arm64": { - "version": "1.0.17-preview.4", - "resolved": "https://registry.npmjs.org/@github/copilot-sdk-linux-arm64/-/copilot-sdk-linux-arm64-1.0.17-preview.4.tgz", - "integrity": "sha512-aOHcV5YiFGhtxh+H3qhOuMzktyhwuepGl/jWkWu2vTLy2oztpMnxmoRgwJaj9NdNQoiM8PO13YjbFhbb3TGaOA==", + "version": "1.0.17-preview.5", + "resolved": "https://registry.npmjs.org/@github/copilot-sdk-linux-arm64/-/copilot-sdk-linux-arm64-1.0.17-preview.5.tgz", + "integrity": "sha512-tDiZnlFfwNYqh2yoqpnRRJjvO47EInrIXn6vMsIMXAO3sAXckSyitP10qWQkOEbhgVjVczwsLE/df64356CyOg==", "cpu": [ "arm64" ], @@ -139,9 +139,9 @@ ] }, "node_modules/@github/copilot-sdk-linux-x64": { - "version": "1.0.17-preview.4", - "resolved": "https://registry.npmjs.org/@github/copilot-sdk-linux-x64/-/copilot-sdk-linux-x64-1.0.17-preview.4.tgz", - "integrity": "sha512-W98/SrLJXVk5xn8GgvUxNs8wHM10nPe5Ff3fU9vKb4Kb0aS2KyxoAhC4eoNn8VRB2XDW2wFTBvUJAutCiWGL+Q==", + "version": "1.0.17-preview.5", + "resolved": "https://registry.npmjs.org/@github/copilot-sdk-linux-x64/-/copilot-sdk-linux-x64-1.0.17-preview.5.tgz", + "integrity": "sha512-eYOibqL5OmI1ulyUcA76gGswzzHXp4Rmvwg4mYGUTFDql9eNy976ASaEwgQTie1FS5gQUKNeiAiLRF9hsrsVHw==", "cpu": [ "x64" ], @@ -155,9 +155,9 @@ ] }, "node_modules/@github/copilot-sdk-linuxmusl-arm64": { - "version": "1.0.17-preview.4", - "resolved": "https://registry.npmjs.org/@github/copilot-sdk-linuxmusl-arm64/-/copilot-sdk-linuxmusl-arm64-1.0.17-preview.4.tgz", - "integrity": "sha512-hym02Fv/JuqjmmMqs4E+XFEgx8nzIpIdMLSr5CFpMLWVVKQYBhY8x6r+03qXhfutUWlcoL5f8gK/pdOR23k9jw==", + "version": "1.0.17-preview.5", + "resolved": "https://registry.npmjs.org/@github/copilot-sdk-linuxmusl-arm64/-/copilot-sdk-linuxmusl-arm64-1.0.17-preview.5.tgz", + "integrity": "sha512-ePJQJg3ohITIQhU35MTSnxKLxweDhaFitohRusO7G5Z4pkfntWgcKdv0rGOejcicDJ7dTiEqwTVSC3Ed1Oe7+g==", "cpu": [ "arm64" ], @@ -171,9 +171,9 @@ ] }, "node_modules/@github/copilot-sdk-linuxmusl-x64": { - "version": "1.0.17-preview.4", - "resolved": "https://registry.npmjs.org/@github/copilot-sdk-linuxmusl-x64/-/copilot-sdk-linuxmusl-x64-1.0.17-preview.4.tgz", - "integrity": "sha512-IhjdLXtUSV8lSZiWsciGHD2iwv3nS2pAwLMywfgB1GozouBDIfWZJlbTUX5Jqv4JeZjE7lpvD5e+Sc11HL6kQQ==", + "version": "1.0.17-preview.5", + "resolved": "https://registry.npmjs.org/@github/copilot-sdk-linuxmusl-x64/-/copilot-sdk-linuxmusl-x64-1.0.17-preview.5.tgz", + "integrity": "sha512-pzxYvWjSzFNiEV+hBzkRhlugGP3C7dQ8jsDYdrdWO7brE8y2/FGcuganmdQWevMPb9V7vQZEbk/SvelC48kmGw==", "cpu": [ "x64" ], @@ -187,9 +187,9 @@ ] }, "node_modules/@github/copilot-sdk-win32-arm64": { - "version": "1.0.17-preview.4", - "resolved": "https://registry.npmjs.org/@github/copilot-sdk-win32-arm64/-/copilot-sdk-win32-arm64-1.0.17-preview.4.tgz", - "integrity": "sha512-MxJJiT2DoDXi3a6dPY/DwMbJPweK75ywlIIbK6Agnof055euC4st3bKMUXz8Nuq4pWzXU3HEWFUVWnNr/63TNw==", + "version": "1.0.17-preview.5", + "resolved": "https://registry.npmjs.org/@github/copilot-sdk-win32-arm64/-/copilot-sdk-win32-arm64-1.0.17-preview.5.tgz", + "integrity": "sha512-H83RaEde07pgVoL978Ala7KaOAPsgNIwMdZRLB2i/BIVIEN7gpceBNVZBYw8l5a/mVGb3fO+UMhJxgUNjQfNDw==", "cpu": [ "arm64" ], @@ -200,9 +200,9 @@ ] }, "node_modules/@github/copilot-sdk-win32-x64": { - "version": "1.0.17-preview.4", - "resolved": "https://registry.npmjs.org/@github/copilot-sdk-win32-x64/-/copilot-sdk-win32-x64-1.0.17-preview.4.tgz", - "integrity": "sha512-NGC8k/WHw6lP6O6h/nJiw3lBaaaMjb1hu+urr+Wpa9EP9a/PFL4rWXpxixgQT4qym7EAVY+EE1vSTA8jCi7cAA==", + "version": "1.0.17-preview.5", + "resolved": "https://registry.npmjs.org/@github/copilot-sdk-win32-x64/-/copilot-sdk-win32-x64-1.0.17-preview.5.tgz", + "integrity": "sha512-AA7BQoNXZl9bbPSqyN2pDXm0Nw2cSNvviQDqU4rMXGX10Ye8RfiLXMMqIGQn8vYYhR1wY+D8/gQCDlv22HvGng==", "cpu": [ "x64" ], diff --git a/remote/package.json b/remote/package.json index 9f718de08d7811..7f95d6d4e01456 100644 --- a/remote/package.json +++ b/remote/package.json @@ -4,7 +4,7 @@ "private": true, "dependencies": { "@devcontainers/cli": "0.88.0", - "@github/copilot-sdk": "1.0.17-preview.4", + "@github/copilot-sdk": "1.0.17-preview.5", "@microsoft/1ds-core-js": "^3.2.13", "@microsoft/1ds-post-js": "^3.2.13", "@microsoft/mxc-sdk": "0.9.0", @@ -78,5 +78,5 @@ "@vscode/windows-ca-certs@0.3.4": true, "@vscode/windows-process-tree@0.8.0": true }, - "copilotRuntimeVersion": "1.0.92-4" + "copilotRuntimeVersion": "1.0.92-5" } diff --git a/src/vs/platform/agentHost/node/copilot/copilotSessionLauncher.ts b/src/vs/platform/agentHost/node/copilot/copilotSessionLauncher.ts index 580f3a85fdcb35..790ce2ac13a630 100644 --- a/src/vs/platform/agentHost/node/copilot/copilotSessionLauncher.ts +++ b/src/vs/platform/agentHost/node/copilot/copilotSessionLauncher.ts @@ -828,7 +828,7 @@ export class CopilotSessionLauncher implements ICopilotSessionLauncher { if (!account) { const sessionHost = auth.host?.replace(/^https?:\/\//, '').replace(/\/+$/, '').toLowerCase(); const matchingAccounts = accounts.filter(candidate => { - const login = candidate.authInfo.type === 'env' || candidate.authInfo.type === 'user' || candidate.authInfo.type === 'gh-cli' + const login = candidate.authInfo.type === 'env' || candidate.authInfo.type === 'user' || candidate.authInfo.type === 'gh-cli' || candidate.authInfo.type === 'account' ? candidate.authInfo.login : candidate.authInfo.copilotUser?.login; const accountHost = candidate.authInfo.host.replace(/^https?:\/\//, '').replace(/\/+$/, '').toLowerCase(); diff --git a/src/vs/platform/agentHost/test/node/copilotSessionLauncher.test.ts b/src/vs/platform/agentHost/test/node/copilotSessionLauncher.test.ts index 802e3d32be1420..83724114e25ec0 100644 --- a/src/vs/platform/agentHost/test/node/copilotSessionLauncher.test.ts +++ b/src/vs/platform/agentHost/test/node/copilotSessionLauncher.test.ts @@ -713,101 +713,104 @@ suite('CopilotSessionLauncher BYOK proxy lifecycle', () => { } }); - test('reconciles connector MCP servers through the Copilot runtime before launch completes', async () => { - const connectorCalls: string[] = []; - let connectorDisplayNames: ReadonlyMap = new Map(); - let featureFlags: Record | undefined; - const session = { - sessionId: 'connector-session', - on: () => () => { }, - disconnect: async () => { }, - rpc: { - options: { update: async () => ({ success: true }) }, - gitHubAuth: { - getStatus: async () => { - connectorCalls.push('auth'); - return { isAuthenticated: true, authType: 'token-provider' as const, host: 'github.com', login: 'octocat' }; - }, - }, - connectors: { - getCapabilities: async () => { - connectorCalls.push('capabilities'); - return { availability: 'enabled' as const }; + for (const authInfo of [ + { type: 'token-provider' as const, host: 'https://github.com', registrationId: 'registration-1', copilotUser: { login: 'octocat' } }, + { type: 'account' as const, host: 'https://github.com', login: 'octocat' }, + ]) { + test(`reconciles connector MCP servers through the Copilot runtime before launch completes (${authInfo.type})`, async () => { + const connectorCalls: string[] = []; + let connectorDisplayNames: ReadonlyMap = new Map(); + let featureFlags: Record | undefined; + const session = { + sessionId: 'connector-session', + on: () => () => { }, + disconnect: async () => { }, + rpc: { + options: { update: async () => ({ success: true }) }, + gitHubAuth: { + getStatus: async () => { + connectorCalls.push('auth'); + return { isAuthenticated: true, authType: authInfo.type, host: 'github.com', login: 'octocat' }; + }, }, - reconcile: async (request: { accountId: string; refreshCatalog?: boolean }) => { - connectorCalls.push(`reconcile:${request.accountId}:${request.refreshCatalog === true}`); - return { - apiVersion: 1, - availability: 'enabled' as const, - catalog: { - revision: 1, - refreshedAtMs: 1, - connectors: [{ name: 'mail', displayName: 'Work IQ Mail', status: 'connected' as const, runtimeServerIds: ['connector-mail'] }], - }, - runtimeServers: [{ runtimeServerId: 'connector-mail', connectorName: 'mail', status: 'connected' as const }], - pendingConnections: 0, - }; + connectors: { + getCapabilities: async () => { + connectorCalls.push('capabilities'); + return { availability: 'enabled' as const }; + }, + reconcile: async (request: { accountId: string; refreshCatalog?: boolean }) => { + connectorCalls.push(`reconcile:${request.accountId}:${request.refreshCatalog === true}`); + return { + apiVersion: 1, + availability: 'enabled' as const, + catalog: { + revision: 1, + refreshedAtMs: 1, + connectors: [{ name: 'mail', displayName: 'Work IQ Mail', status: 'connected' as const, runtimeServerIds: ['connector-mail'] }], + }, + runtimeServers: [{ runtimeServerId: 'connector-mail', connectorName: 'mail', status: 'connected' as const }], + pendingConnections: 0, + }; + }, }, }, - }, - } as unknown as CopilotSession; - const client = { - rpc: { - account: { - getAllUsers: async () => { - connectorCalls.push('accounts'); - return [{ - authInfo: { - type: 'token-provider' as const, - host: 'https://github.com', - registrationId: 'registration-1', - copilotUser: { login: 'octocat' }, - }, - selectionId: 'account-1', - }]; + } as unknown as CopilotSession; + const client = { + rpc: { + account: { + getAllUsers: async () => { + connectorCalls.push('accounts'); + return [{ + authInfo: { ...authInfo, login: 'another-user', copilotUser: { login: 'another-user' } }, + selectionId: 'another-account', + }, { + authInfo, + selectionId: 'account-1', + }]; + }, }, }, - }, - createSession: async (config: Parameters[0]) => { - reportManagedSettings(config); - featureFlags = config.featureFlags; - return session; - }, - resumeSession: async () => { throw new Error('Unexpected resume'); }, - } as unknown as CopilotClient; - const launcher = createTestLauncher(undefined, { [AgentHostMcpConnectorsEnabledConfigKey]: true }); - const plan: CopilotSessionLaunchPlan = { - kind: 'create', - client, - extensionSdkPath: '/copilot-sdk', - sessionId: 'connector-session', - workingDirectory: testWorkingDirectory, - resolvedAgentName: undefined, - snapshot: { tools: [], plugins: [], mcpServers: {} }, - activeClientToolSet: new ActiveClientToolSet(), - shellManager: undefined, - githubCredentials: CopilotGitHubSessionCredentials.fromToken('connector-token'), - model: undefined, - }; + createSession: async (config: Parameters[0]) => { + reportManagedSettings(config); + featureFlags = config.featureFlags; + return session; + }, + resumeSession: async () => { throw new Error('Unexpected resume'); }, + } as unknown as CopilotClient; + const launcher = createTestLauncher(undefined, { [AgentHostMcpConnectorsEnabledConfigKey]: true }); + const plan: CopilotSessionLaunchPlan = { + kind: 'create', + client, + extensionSdkPath: '/copilot-sdk', + sessionId: 'connector-session', + workingDirectory: testWorkingDirectory, + resolvedAgentName: undefined, + snapshot: { tools: [], plugins: [], mcpServers: {} }, + activeClientToolSet: new ActiveClientToolSet(), + shellManager: undefined, + githubCredentials: CopilotGitHubSessionCredentials.fromToken('connector-token'), + model: undefined, + }; - const launched = await launcher.launch(plan, { - ...testRuntime, - setMcpServerDisplayNames: displayNames => connectorDisplayNames = new Map(displayNames), - }); - try { - assert.deepStrictEqual({ - featureFlags, - connectorCalls, - connectorDisplayName: connectorDisplayNames.get('connector-mail'), - }, { - featureFlags: { CONNECTORS: true, TGREP: false, CONTENT_EXCLUSION: true, MANAGED_MCP_SERVERS: true }, - connectorCalls: ['capabilities', 'auth', 'accounts', 'reconcile:account-1:true'], - connectorDisplayName: 'Work IQ Mail', + const launched = await launcher.launch(plan, { + ...testRuntime, + setMcpServerDisplayNames: displayNames => connectorDisplayNames = new Map(displayNames), }); - } finally { - launched.dispose(); - } - }); + try { + assert.deepStrictEqual({ + featureFlags, + connectorCalls, + connectorDisplayName: connectorDisplayNames.get('connector-mail'), + }, { + featureFlags: { CONNECTORS: true, TGREP: false, CONTENT_EXCLUSION: true, MANAGED_MCP_SERVERS: true }, + connectorCalls: ['capabilities', 'auth', 'accounts', 'reconcile:account-1:true'], + connectorDisplayName: 'Work IQ Mail', + }); + } finally { + launched.dispose(); + } + }); + } });