Copilot CLI: Pick From Sessions When Sending References#3619
Merged
DonJayamanne merged 2 commits intomainfrom Feb 10, 2026
Merged
Copilot CLI: Pick From Sessions When Sending References#3619DonJayamanne merged 2 commits intomainfrom
DonJayamanne merged 2 commits intomainfrom
Conversation
4feda0c to
8db6826
Compare
Contributor
There was a problem hiding this comment.
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
addFileReferencecommand to send notifications to a chosen session via newInProcHttpServer.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. |
src/extension/agents/copilotcli/vscode-node/commands/addFileReference.ts
Show resolved
Hide resolved
src/extension/agents/copilotcli/vscode-node/test/testHelpers.ts
Outdated
Show resolved
Hide resolved
8db6826 to
e59c5d9
Compare
MRayermannMSFT
commented
Feb 10, 2026
| } | ||
|
|
||
| getSessionDisplayName(sessionId: string): string { | ||
| // todo: get session display name from the CLI |
Member
Author
There was a problem hiding this comment.
Working on this: https://github.com/github/copilot-agent-runtime/pull/3012
DonJayamanne
approved these changes
Feb 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
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.