From d373331a40aa1663f44d77d217db8098f470b2b9 Mon Sep 17 00:00:00 2001 From: Osvaldo Ortega Date: Fri, 27 Feb 2026 14:34:59 -0800 Subject: [PATCH] feat: add mock GitHub authentication provider and update activation events for mock chat provider --- .../mock-chat-provider/extension.js | 24 +++++++++++++++++++ .../mock-chat-provider/package.json | 2 +- 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/src/vs/sessions/test/e2e/extensions/mock-chat-provider/extension.js b/src/vs/sessions/test/e2e/extensions/mock-chat-provider/extension.js index f7682ee9a36..5732b3249fe 100644 --- a/src/vs/sessions/test/e2e/extensions/mock-chat-provider/extension.js +++ b/src/vs/sessions/test/e2e/extensions/mock-chat-provider/extension.js @@ -11,6 +11,30 @@ const vscode = require('vscode'); * @param {vscode.ExtensionContext} context */ function activate(context) { + // Register a fake GitHub auth provider so the sessions welcome overlay + // sees a signed-in user and dismisses itself. + const fakeSession = { + id: 'fake-session-id', + accessToken: 'fake-token', + account: { id: 'test-user', label: 'Test User' }, + scopes: ['read:user'], + }; + + context.subscriptions.push( + vscode.authentication.registerAuthenticationProvider( + 'github', + 'GitHub (Mock)', + { + onDidChangeSessions: new vscode.EventEmitter().event, + getSessions: async () => [fakeSession], + createSession: async () => fakeSession, + removeSession: async () => { }, + }, + { supportsMultipleAccounts: false } + ) + ); + + // Register a mock chat participant so chat input works without a real LLM. const participant = vscode.chat.createChatParticipant( 'mock-chat-provider.mock', async (_request, _context, stream, _token) => { diff --git a/src/vs/sessions/test/e2e/extensions/mock-chat-provider/package.json b/src/vs/sessions/test/e2e/extensions/mock-chat-provider/package.json index 7b88a2a112f..07743d977ae 100644 --- a/src/vs/sessions/test/e2e/extensions/mock-chat-provider/package.json +++ b/src/vs/sessions/test/e2e/extensions/mock-chat-provider/package.json @@ -4,7 +4,7 @@ "description": "Provides a mock chat participant for agent sessions testing", "version": "0.0.1", "engines": { "vscode": "*" }, - "activationEvents": ["onStartupFinished"], + "activationEvents": ["*"], "main": "./extension.js", "contributes": { "chatParticipants": [