Fix Power Pages copilot registration to ensure @powerpages chat participant is always available
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:
- After successful authentication and ECS initialization
- During org change error events as a fallback
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:
- Added
registerCopilotPanels(pacWrapper)call during extension activation insrc/client/extension.ts - Enhanced logging to track when copilot panels are registered
- Added integration test to validate the fix
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:
// Chat participant only registered after org events
orgChangeEvent(async (orgDetails) => {
// ... after successful auth/ECS init ...
registerCopilotPanels(pacWrapper);
});
After:
// Chat participant registered immediately during activation
const pacWrapper = pacTerminal.getWrapper();
const basicPanels = RegisterBasicPanels(pacWrapper);
_context.subscriptions.push(...basicPanels);
// Register copilot panels immediately to ensure chat participant is always available
registerCopilotPanels(pacWrapper);
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.