Fix Power Pages copilot registration to ensure @powerpages chat participant is always available #1309
+58
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The Power Pages copilot chat participant (
@powerpages
) was not being registered in certain scenarios, causing users to encounter the error "no activated agent with id 'powerpages'" when trying to use the chat functionality.Problem
The chat participant registration was conditional and only occurred during specific org change events:
However, if the extension activated without triggering these events (e.g., user not authenticated, machine not enrolled in Entra ID), the chat participant would never be registered, making
@powerpages
completely unavailable.Solution
This PR registers the copilot panels (including the chat participant) immediately during extension activation, ensuring
@powerpages
is always available regardless of authentication state.Key changes:
registerCopilotPanels(pacWrapper)
call during extension activation insrc/client/extension.ts
The PowerPagesChatParticipant already has proper error handling for unauthenticated scenarios - it will show appropriate error messages and login prompts when users try to use it without authentication, rather than being completely unavailable.
Before vs After
Before:
After:
This minimal change ensures users can always access
@powerpages
functionality, with proper authentication prompts when needed, eliminating the "no activated agent" error.Fixes #1307.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.