Skip to content

Conversation

Copilot
Copy link

@Copilot Copilot AI commented Sep 23, 2025

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 in src/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.

@Copilot Copilot AI changed the title [WIP] Cannot log into copilot in power pages Fix Power Pages copilot registration to ensure @powerpages chat participant is always available Sep 23, 2025
@Copilot Copilot AI requested a review from amitjoshi438 September 23, 2025 11:52
Copilot finished work on behalf of amitjoshi438 September 23, 2025 11:52
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.

Cannot log into copilot in power pages
2 participants