Skip to content

Conversation

@roblourens
Copy link
Member

@roblourens roblourens commented Nov 8, 2025

Merge candidate PR #1860 to main

Copilot AI review requested due to automatic review settings November 8, 2025 21:39
@roblourens roblourens enabled auto-merge November 8, 2025 21:39
@roblourens roblourens self-assigned this Nov 8, 2025
@vs-code-engineering vs-code-engineering bot added this to the November 2025 milestone Nov 8, 2025
@roblourens roblourens changed the title Merge pull request #1860 from microsoft/roblou/revert-chat-activation Restore activationBlockers on auth Nov 8, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces an activation blocker mechanism to prevent the extension from completing activation until critical async operations (authentication and embeddings registration) are complete. Previously, chat requests could fail if they arrived before authentication was ready.

Key Changes:

  • Added activationBlocker property to IExtensionContribution interface that delays extension activation
  • Modified ConversationFeature and LanguageModelAccess to wait for authentication before completing activation
  • Removed redundant request blocking logic from ChatAgents (formerly ChatParticipants) class

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/extension/common/contributions.ts Added activationBlocker property to contribution interface and logic to wait for all blockers before activation completes
src/extension/extension/vscode/extension.ts Updated to await waitForActivationBlockers() and removed unused log service import
src/extension/conversation/vscode-node/conversationFeature.ts Implemented activationBlocker that resolves when authentication token is available
src/extension/conversation/vscode-node/languageModelAccess.ts Implemented activationBlocker for chat provider and embeddings registration, improved embeddings re-registration on auth change
src/extension/conversation/vscode-node/chatParticipants.ts Removed redundant request blocking logic (now handled by ConversationFeature), renamed class from ChatParticipants to ChatAgents
src/extension/conversation/vscode-node/test/conversationFeature.test.ts Added test to verify feature behavior when interactive version doesn't match

this.activated = false;
}

activationBlockerDeferred.complete();
Copy link

Copilot AI Nov 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The activationBlockerDeferred.complete() can be called multiple times if the authentication changes multiple times. DeferredPromise.complete() should only be called once. Consider adding a check to ensure it's only called once, or restructure to complete the promise on the first authentication event (whether token exists or not).

Copilot uses AI. Check for mistakes.
const sw = StopWatch.create();
const id = instance.id || 'UNKNOWN';
this.allActivationBlockers.push(instance.activationBlocker.finally(() => {
logService.info(`activationBlocker from '${id}' took for ${Math.round(sw.elapsed())}ms`);
Copy link

Copilot AI Nov 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Corrected grammar: 'took for' should be 'took'.

Suggested change
logService.info(`activationBlocker from '${id}' took for ${Math.round(sw.elapsed())}ms`);
logService.info(`activationBlocker from '${id}' took ${Math.round(sw.elapsed())}ms`);

Copilot uses AI. Check for mistakes.
@roblourens roblourens added this pull request to the merge queue Nov 8, 2025
Merged via the queue into main with commit 6484cd7 Nov 8, 2025
22 checks passed
@roblourens roblourens deleted the roblou/distinctive-orangutan branch November 8, 2025 23:05
DonJayamanne pushed a commit that referenced this pull request Nov 10, 2025
…#1878)

Restore activationBlockers on auth

Co-authored-by: Logan Ramos <loganramos@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants