Skip to content

Copilot CLI: Pick From Sessions When Sending References#3619

Merged
DonJayamanne merged 2 commits intomainfrom
mrayermannmsft/feat/pickfromsessions
Feb 10, 2026
Merged

Copilot CLI: Pick From Sessions When Sending References#3619
DonJayamanne merged 2 commits intomainfrom
mrayermannmsft/feat/pickfromsessions

Conversation

@MRayermannMSFT
Copy link
Copy Markdown
Member

@MRayermannMSFT MRayermannMSFT commented Feb 10, 2026

When sending references, if we have multiple CLI sessions conected, we'll now pop up a picker asking the user which to send the file references to.

@MRayermannMSFT MRayermannMSFT force-pushed the mrayermannmsft/feat/pickfromsessions branch 2 times, most recently from 4feda0c to 8db6826 Compare February 10, 2026 20:37
@MRayermannMSFT MRayermannMSFT marked this pull request as ready for review February 10, 2026 20:54
Copilot AI review requested due to automatic review settings February 10, 2026 20:54
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds multi-session awareness to the Copilot CLI “add file reference” flow by selecting a specific connected CLI session (and prompting the user when more than one is connected), rather than broadcasting to all sessions.

Changes:

  • Introduces pickSession() helper to choose a target CLI session (auto-pick if only one, Quick Pick if multiple, warn if none).
  • Updates addFileReference command to send notifications to a chosen session via new InProcHttpServer.sendNotification().
  • Extends session tracking to support display names and adds unit tests covering picker behavior and edge cases.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/extension/agents/copilotcli/vscode-node/test/testHelpers.ts Extends mocks to support targeted notifications and introduces a mock session tracker for picker tests.
src/extension/agents/copilotcli/vscode-node/test/addFileReference.spec.ts Updates/expands tests for targeted send + session picking flows.
src/extension/agents/copilotcli/vscode-node/inProcHttpServer.ts Adds sendNotification and getConnectedSessionIds to enable per-session messaging.
src/extension/agents/copilotcli/vscode-node/copilotCLISessionTracker.ts Adds session display name + session ID enumeration APIs.
src/extension/agents/copilotcli/vscode-node/contribution.ts Wires the session tracker into registerAddFileReferenceCommand.
src/extension/agents/copilotcli/vscode-node/commands/pickSession.ts New helper that implements the session selection UI/logic.
src/extension/agents/copilotcli/vscode-node/commands/addFileReference.ts Uses pickSession and sends to a specific session instead of broadcasting.
@MRayermannMSFT MRayermannMSFT force-pushed the mrayermannmsft/feat/pickfromsessions branch from 8db6826 to e59c5d9 Compare February 10, 2026 21:16
}

getSessionDisplayName(sessionId: string): string {
// todo: get session display name from the CLI
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@vs-code-engineering vs-code-engineering bot added this to the February 2026 milestone Feb 10, 2026
@DonJayamanne DonJayamanne added this pull request to the merge queue Feb 10, 2026
Merged via the queue into main with commit 42a740e Feb 10, 2026
19 checks passed
@DonJayamanne DonJayamanne deleted the mrayermannmsft/feat/pickfromsessions branch February 10, 2026 22:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

4 participants