Skip to content

Automatic activation event for chat context provider#280677

Merged
alexr00 merged 2 commits intomicrosoft:mainfrom
vedbhadani:fix/chat-context-provider-activation
Jan 20, 2026
Merged

Automatic activation event for chat context provider#280677
alexr00 merged 2 commits intomicrosoft:mainfrom
vedbhadani:fix/chat-context-provider-activation

Conversation

@vedbhadani
Copy link
Contributor

Fixes #280643

Problem

Extensions contributing chat context providers were not being activated when their context providers were needed. This was because the chatContext extension point was missing an activationEventsGenerator.

Solution

Added an activationEventsGenerator to the chatContext extension point registration, following the same pattern used in other extension points like chatParticipants.

The generator yields onChatContextProvider:${contrib.id} for each chatContext contribution, ensuring extensions are properly activated when their context providers are needed.

Testing

This fix enables the activation event pattern documented in the API:

  • Extensions define onChatContextProvider:<id> in their activation events
  • VSCode now properly activates these extensions when the context provider is requestedFixes Activation event not working #280643

The issue was that extensions contributing chat context providers were not being activated when their context providers were needed. This was because the chatContext extension point was missing an activationEventsGenerator.

When an extension contributes a chatContext item in package.json, it also defines an activation event like 'onChatContextProvider:my-chat-context-provider'. However, without the activationEventsGenerator, VSCode didn't know to activate the extension when that context provider was requested.

This commit adds an activationEventsGenerator to the chatContext extension point registration, following the same pattern used in other extension points like chatParticipants. The generator yields 'onChatContextProvider:${contrib.id}' for each chatContext contribution, ensuring extensions are properly activated when their context providers are needed.

Fixes microsoft#280643

The issue was that extensions contributing chat context providers were not being activated when their context providers were needed. This was because the chatContext extension point was missing an activationEventsGenerator.

When an extension contributes a chatContext item in package.json, it also defines an activation event like 'onChatContextProvider:my-chat-context-provider'. However, without the activationEventsGenerator, VSCode didn't know to activate the extension when that context provider was requested.

This commit adds an activationEventsGenerator to the chatContext extension point registration, following the same pattern used in other extension points like chatParticipants. The generator yields 'onChatContextProvider:${contrib.id}' for each chatContext contribution, ensuring extensions are properly activated when their context providers are needed.
@vedbhadani vedbhadani changed the title Fix onChatContextProvider activation event not workingFix onChatContextProvider activation event not working Fix onChatContextProvider activation event not workingFix onChatContextProvider activation event not workingFix onChatContextProvider activation event not working Dec 2, 2025
@vedbhadani vedbhadani changed the title Fix onChatContextProvider activation event not workingFix onChatContextProvider activation event not workingFix onChatContextProvider activation event not working Fix onChatContextProvider activation event not working Dec 2, 2025
@alexr00 alexr00 added this to the December / January 2026 milestone Dec 3, 2025
@alexr00 alexr00 modified the milestones: December 2025, January 2026 Jan 12, 2026
Copy link
Member

@alexr00 alexr00 left a comment

Choose a reason for hiding this comment

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

This is a fine change, but it doesn't actually fix #280643

@alexr00 alexr00 enabled auto-merge (squash) January 20, 2026 10:24
@alexr00 alexr00 changed the title Fix onChatContextProvider activation event not working Automatic activation event for chat context provider Jan 20, 2026
@alexr00 alexr00 merged commit 9aaa385 into microsoft:main Jan 20, 2026
17 checks passed
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.

Activation event not working

3 participants

Comments