From d4b9313fa697eb9efe82e17e78da6863824001fa Mon Sep 17 00:00:00 2001 From: Rob Lourens Date: Wed, 18 Feb 2026 16:47:40 +0000 Subject: [PATCH] Reenable agent sanity test (#3814) * Reenable agent sanity test * This way --- .../test/vscode-node/sanity.sanity-test.ts | 14 +++++++++++--- .../authentication/node/copilotTokenManager.ts | 2 +- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/extensions/copilot/src/extension/test/vscode-node/sanity.sanity-test.ts b/extensions/copilot/src/extension/test/vscode-node/sanity.sanity-test.ts index 1d05cb4f211..04fbaa7f8d6 100644 --- a/extensions/copilot/src/extension/test/vscode-node/sanity.sanity-test.ts +++ b/extensions/copilot/src/extension/test/vscode-node/sanity.sanity-test.ts @@ -20,6 +20,10 @@ import { ContributedToolName } from '../../tools/common/toolNames'; import { IToolsService } from '../../tools/common/toolsService'; import { TestChatRequest } from '../node/testHelpers'; +/** + * Running these locally? You may have to run `npm run setup` again + */ + suite('Copilot Chat Sanity Test', function () { this.timeout(1000 * 60 * 1); // 1 minute @@ -95,7 +99,11 @@ suite('Copilot Chat Sanity Test', function () { }); }); - test.skip('E2E Production agent mode', async function () { + /** + * Runs tools outside of a real chat session which is unusual but lets us spy more + * Uses an empty window with no folder open + */ + test('E2E Production agent mode', async function () { assert.ok(realInstaAccessor, 'Instantiation service accessor is not available'); await realInstaAccessor.invokeFunction(async (accessor) => { @@ -107,8 +115,8 @@ suite('Copilot Chat Sanity Test', function () { try { conversationFeature.activated = true; let stream = new SpyChatResponseStream(); - const testRequest = new TestChatRequest(`You must use the search tool to search for "foo". It may fail, that's ok, just testing`); - testRequest.tools.set(ContributedToolName.FindTextInFiles, true); + const testRequest = new TestChatRequest(`You must use the get_errors tool to check the window for errors. It may fail, that's ok, just testing, don't retry.`); + testRequest.tools.set(ContributedToolName.GetErrors, true); let interactiveSession = instaService.createInstance(ChatParticipantRequestHandler, [], testRequest, stream, fakeToken, { agentName: '', agentId: '', intentId: Intent.Agent }, () => false); const onWillInvokeTool = Event.toPromise(toolsService.onWillInvokeTool); diff --git a/extensions/copilot/src/platform/authentication/node/copilotTokenManager.ts b/extensions/copilot/src/platform/authentication/node/copilotTokenManager.ts index e3ab1725bcd..49d2189fce0 100644 --- a/extensions/copilot/src/platform/authentication/node/copilotTokenManager.ts +++ b/extensions/copilot/src/platform/authentication/node/copilotTokenManager.ts @@ -69,7 +69,7 @@ export function getOrCreateTestingCopilotTokenManager(deviceId: string): SyncDes } if (process.env.GITHUB_OAUTH_TOKEN) { - return new SyncDescriptor(CopilotTokenManagerFromGitHubToken, [process.env.GITHUB_OAUTH_TOKEN]); + return new SyncDescriptor(CopilotTokenManagerFromGitHubToken, [process.env.GITHUB_OAUTH_TOKEN, 'unknown']); } if (process.env.GITHUB_PAT) {