Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 21, 2026

Clicking "+ New Chat Session" from the agent target dropdown during an in-progress cloud agent session did nothing. The command was invoked with only a position string ('sidebar'/'editor'), so getEditingSessionContext() fell back to lastFocusedWidget—which may not be the chat widget during cloud agent sessions.

Changes

  • ISessionTypePickerDelegate: Add optional getSessionResource() method
  • chatInputPart.ts: Provide session resource via delegate
  • DelegationSessionPickerActionItem: Pass proper IChatViewTitleActionContext when executing ACTION_ID_NEW_CHAT
// Before: widget lookup fails when focus is elsewhere
this.commandService.executeCommand(ACTION_ID_NEW_CHAT, this.chatSessionPosition);

// After: explicit context ensures correct widget resolution
const context: IChatViewTitleActionContext = {
  $mid: MarshalledId.ChatViewContext,
  sessionResource
};
this.commandService.executeCommand(ACTION_ID_NEW_CHAT, context);
Original prompt

This section details on the original issue you should resolve

<issue_title>Cannot use + New Chat Session from in-progress session</issue_title>
<issue_description>

Ref https://github.com/microsoft/vscode-internalbacklog/issues/6527

  • Kick off a cloud agent session
  • Open agent target dropdown
  • Select + New Chat Session
  • ❓ Nothing happens

Image</issue_description>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

…ontext

The issue was that when clicking "+ New Chat Session" from the agent target
dropdown during an in-progress session, the command was being executed with
just the position string ('sidebar' or 'editor') instead of a proper
IChatViewTitleActionContext. This meant getEditingSessionContext() couldn't
find the widget via the context and had to fall back to lastFocusedWidget,
which may not return the correct widget during cloud agent sessions.

The fix:
1. Added getSessionResource() method to ISessionTypePickerDelegate interface
2. Updated chatInputPart.ts to provide the session resource via the delegate
3. Updated DelegationSessionPickerActionItem to pass a proper
   IChatViewTitleActionContext when executing ACTION_ID_NEW_CHAT

Co-authored-by: benibenj <44439583+benibenj@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix inability to use + New Chat Session in in-progress session Fix "+ New Chat Session" from in-progress cloud agent session Jan 21, 2026
Copilot AI requested a review from benibenj January 21, 2026 09:49
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 use + New Chat Session from in-progress session

2 participants