Merge agents and chatsession folder#4058
Merged
DonJayamanne merged 1 commit intomainfrom Feb 27, 2026
Merged
Conversation
TylerLeonhardt
previously approved these changes
Feb 27, 2026
03b7fdd to
d4a7725
Compare
TylerLeonhardt
approved these changes
Feb 27, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR restructures the extension’s Copilot CLI and Claude “agents” implementation into the chatSessions/ area, updating import paths throughout and adding new Copilot CLI (MCP + push notification) infrastructure and Claude session utilities consistent with the new folder layout.
Changes:
- Moved Copilot CLI + Claude chat-session-related code from
extension/agents/...intoextension/chatSessions/...and updated imports in runtime + test code. - Added Copilot CLI VS Code-side MCP server contribution, tools (diff/selection/diagnostics/session naming), push notifications, lockfile management, and session tracking.
- Added Claude chat-session registries (hooks, MCP servers, slash commands) + permission handlers and supporting utilities/tests under
chatSessions/claude/....
Reviewed changes
Copilot reviewed 20 out of 168 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| test/e2e/cli.stest.ts | Updates Copilot CLI import paths to new chatSessions/copilotcli/... locations. |
| src/extension/test/node/services.ts | Re-points Claude service/test registrations to chatSessions/claude/.... |
| src/extension/prompts/node/agent/test/parseAttachments.spec.ts | Updates Copilot CLI prompt/image resolver imports to chatSessions/copilotcli/.... |
| src/extension/chatSessions/vscode-node/test/folderRepositoryManager.spec.ts | Updates session service import to local chatSessions/copilotcli/.... |
| src/extension/chatSessions/vscode-node/test/copilotCLISDKUpgrade.spec.ts | Updates shim copy helper imports to new Copilot CLI location. |
| src/extension/chatSessions/vscode-node/test/copilotCLIChatSessionParticipant.spec.ts | Updates Copilot CLI imports to new chatSessions/copilotcli/... paths. |
| src/extension/chatSessions/vscode-node/test/claudeChatSessionContentProvider.spec.ts | Updates Claude imports to new chatSessions/claude/... paths. |
| src/extension/chatSessions/vscode-node/test/chatSessionMetadataStoreImpl.spec.ts | Updates cliHelpers import + mock path for new Copilot CLI location. |
| src/extension/chatSessions/vscode-node/test/chatHistoryBuilder.spec.ts | Updates Claude session parser imports to new chatSessions/claude/... paths. |
| src/extension/chatSessions/vscode-node/test/askUserQuestionHandler.spec.ts | Updates UserInputRequest import to new Copilot CLI location. |
| src/extension/chatSessions/vscode-node/folderRepositoryManagerImpl.ts | Updates Copilot CLI imports to new relative locations within chatSessions. |
| src/extension/chatSessions/vscode-node/copilotCloudSessionsProvider.ts | Updates delegation summary import to new Copilot CLI location. |
| src/extension/chatSessions/vscode-node/copilotCLIChatSessionsContribution.ts | Updates Copilot CLI-related imports to new chatSessions/copilotcli/... paths. |
| src/extension/chatSessions/vscode-node/claudeChatSessionContentProvider.ts | Updates Claude imports + self-registration imports to new chatSessions/claude/... paths. |
| src/extension/chatSessions/vscode-node/chatSessions.ts | Updates Claude + Copilot CLI wiring imports to new chatSessions/... layout. |
| src/extension/chatSessions/vscode-node/chatSessionMetadataStoreImpl.ts | Updates getCopilotCLISessionStateDir import to new Copilot CLI location. |
| src/extension/chatSessions/vscode-node/chatHistoryBuilder.ts | Updates Claude formatter/schema imports to new chatSessions/claude/.... |
| src/extension/chatSessions/vscode-node/askUserQuestionHandler.ts | Updates Copilot CLI user-input helper import to new location. |
| src/extension/chatSessions/copilotcli/vscode-node/tools/utils.ts | Adds shared MCP tool result formatting helper. |
| src/extension/chatSessions/copilotcli/vscode-node/tools/updateSessionName.ts | Adds MCP tool to set a session display name via session tracker. |
| src/extension/chatSessions/copilotcli/vscode-node/tools/push/selectionChanged.ts | Adds push notification for editor selection changes (debounced). |
| src/extension/chatSessions/copilotcli/vscode-node/tools/push/diagnosticsChanged.ts | Adds push notification for diagnostics changes (debounced). |
| src/extension/chatSessions/copilotcli/vscode-node/tools/push/index.ts | Exports push notification registration helpers. |
| src/extension/chatSessions/copilotcli/vscode-node/tools/index.ts | Central registration for Copilot CLI MCP tools. |
| src/extension/chatSessions/copilotcli/vscode-node/tools/getVscodeInfo.ts | Adds MCP tool returning VS Code env/version info. |
| src/extension/chatSessions/copilotcli/vscode-node/tools/getSelection.ts | Adds MCP tool + cached state for selection retrieval. |
| src/extension/chatSessions/copilotcli/vscode-node/tools/getDiagnostics.ts | Adds MCP tool for VS Code diagnostics (optionally per-URI). |
| src/extension/chatSessions/copilotcli/vscode-node/tools/closeDiff.ts | Adds MCP tool to close a diff by tab name. |
| src/extension/chatSessions/copilotcli/vscode-node/readonlyContentProvider.ts | Adds readonly content provider + URI factory for diff views. |
| src/extension/chatSessions/copilotcli/vscode-node/lockFile.ts | Adds lockfile creation/update/removal + stale lockfile cleanup. |
| src/extension/chatSessions/copilotcli/vscode-node/diffState.ts | Adds in-memory diff tracking + context key updates. |
| src/extension/chatSessions/copilotcli/vscode-node/contribution.ts | Adds Copilot CLI VS Code contribution wiring server/tools/commands/lockfile. |
| src/extension/chatSessions/copilotcli/vscode-node/commands/context.ts | Adds context key management for “has session connected”. |
| src/extension/chatSessions/copilotcli/vscode-node/commands/diffCommands.ts | Adds accept/reject commands for active diff tabs. |
| src/extension/chatSessions/copilotcli/vscode-node/commands/addSelection.ts | Adds “add selection” command that sends editor context to CLI session. |
| src/extension/chatSessions/copilotcli/vscode-node/commands/addFileReference.ts | Adds “add file reference” command (explorer URI or active editor). |
| src/extension/chatSessions/copilotcli/vscode-node/commands/sendContext.ts | Implements URI scheme validation + notification sending for file/selection context. |
| src/extension/chatSessions/copilotcli/vscode-node/commands/pickSession.ts | Adds session picker logic using session tracker display names. |
| src/extension/chatSessions/copilotcli/vscode-node/commands/index.ts | Exposes Copilot CLI command registrations. |
| src/extension/chatSessions/copilotcli/vscode-node/test/updateSessionName.spec.ts | Unit tests for update_session_name MCP tool behavior. |
| src/extension/chatSessions/copilotcli/vscode-node/test/selectionChanged.spec.ts | Unit tests for selection change push notification behavior. |
| src/extension/chatSessions/copilotcli/vscode-node/test/readonlyContentProvider.spec.ts | Unit tests for readonly content provider storage/registration. |
| src/extension/chatSessions/copilotcli/vscode-node/test/inProcHttpServer.spec.ts | Unit tests for server disconnect listener behavior. |
| src/extension/chatSessions/copilotcli/vscode-node/test/getVscodeInfo.spec.ts | Unit tests for VS Code info MCP tool. |
| src/extension/chatSessions/copilotcli/vscode-node/test/getSelection.spec.ts | Unit tests for selection info/state + MCP tool. |
| src/extension/chatSessions/copilotcli/vscode-node/test/diffCommands.spec.ts | Unit tests for accept/reject diff commands. |
| src/extension/chatSessions/copilotcli/vscode-node/test/context.spec.ts | Unit tests for session-connected context key behavior. |
| src/extension/chatSessions/copilotcli/vscode-node/test/closeAllForSession.spec.ts | Unit tests for closing diffs when a session disconnects. |
| src/extension/chatSessions/copilotcli/node/userInputHelpers.ts | Adds Copilot CLI user-input helper types + handler interface under chatSessions. |
| src/extension/chatSessions/copilotcli/node/cliHelpers.ts | Adds state dir helpers under new Copilot CLI location. |
| src/extension/chatSessions/copilotcli/node/ripgrepShim.ts | Adds/relocates ripgrep shim materialization logic. |
| src/extension/chatSessions/copilotcli/node/nodePtyShim.ts | Adjusts error typing in node-pty shim copy/retry logic. |
| src/extension/chatSessions/copilotcli/node/logger.ts | Minor formatting change after relocation. |
| src/extension/chatSessions/copilotcli/node/customSessionTitleServiceImpl.ts | Adds custom session title persistence implementation in new location. |
| src/extension/chatSessions/copilotcli/common/customSessionTitleService.ts | Adds Copilot CLI custom session title service interface in new location. |
| src/extension/chatSessions/copilotcli/common/delegationSummaryService.ts | Adds delegation summary service in new chatSessions structure. |
| src/extension/chatSessions/common/externalEditTracker.ts | Introduces shared external edit lifecycle tracking (used by Claude + CLI). |
| src/extension/chatSessions/common/test/externalEditTracker.spec.ts | Unit tests for external edit tracker ignore-directory filtering. |
| src/extension/chatSessions/claude/common/claudeTools.ts | Adds Claude tool name/type mapping and edit-tool URI extraction utilities. |
| src/extension/chatSessions/claude/common/claudeToolPermission.ts | Adds Claude tool permission handler contracts + result types. |
| src/extension/chatSessions/claude/common/claudeToolPermissionRegistry.ts | Adds global registry for permission handlers. |
| src/extension/chatSessions/claude/common/claudeToolPermissionService.ts | Adds permission orchestration service (auto-approve/confirm/custom handlers). |
| src/extension/chatSessions/claude/common/toolPermissionHandlers/index.ts | Adds common permission handler self-registration entrypoint. |
| src/extension/chatSessions/claude/common/toolPermissionHandlers/askUserQuestionHandler.ts | Adds handler delegating to core ask-questions tool. |
| src/extension/chatSessions/claude/common/toolPermissionHandlers/bashToolHandler.ts | Adds bash confirmation handler using terminal confirmation tool. |
| src/extension/chatSessions/claude/common/toolPermissionHandlers/exitPlanModeHandler.ts | Adds ExitPlanMode confirmation handler showing Claude’s plan. |
| src/extension/chatSessions/claude/common/claudeHookRegistry.ts | Adds hook registry + builder using DI. |
| src/extension/chatSessions/claude/common/hooks/index.ts | Adds common hooks self-registration entrypoint. |
| src/extension/chatSessions/claude/common/claudeMcpServerRegistry.ts | Adds MCP server contributor registry + builder using DI. |
| src/extension/chatSessions/claude/common/mcpServers/index.ts | Adds common MCP server self-registration entrypoint. |
| src/extension/chatSessions/claude/common/mcpServers/ideMcpServer.ts | Adds “ide” MCP server (diagnostics tool) contribution. |
| src/extension/chatSessions/claude/common/slashCommands/index.ts | Adds common slash commands self-registration entrypoint. |
| src/extension/chatSessions/claude/common/claudeSessionUri.ts | Adds URI helpers for Claude session scheme. |
| src/extension/chatSessions/claude/common/claudeFolderInfo.ts | Adds Claude folder metadata type. |
| src/extension/chatSessions/claude/node/hooks/index.ts | Adds node hook self-registration entrypoint. |
| src/extension/chatSessions/claude/node/hooks/loggingHooks.ts | Adds node logging hooks for SDK events. |
| src/extension/chatSessions/claude/node/hooks/sessionHooks.ts | Adds session start/end logging hooks. |
| src/extension/chatSessions/claude/node/hooks/subagentHooks.ts | Adds subagent start/stop logging hooks. |
| src/extension/chatSessions/claude/node/hooks/toolHooks.ts | Adds tool-use logging hooks + plan mode tracking hook. |
| src/extension/chatSessions/claude/node/mcpServers/index.ts | Adds node MCP self-registration entrypoint. |
| src/extension/chatSessions/claude/node/slashCommands/index.ts | Adds node slash-command self-registration entrypoint. |
| src/extension/chatSessions/claude/node/toolPermissionHandlers/index.ts | Adds node permission handler self-registration entrypoint. |
| src/extension/chatSessions/claude/node/toolPermissionHandlers/editToolHandler.ts | Adds auto-approve policy for edit tools based on mode/workspace. |
| src/extension/chatSessions/claude/node/claudeProjectFolders.ts | Adds Claude project folder discovery + slug computation. |
| src/extension/chatSessions/claude/node/claudeSessionTitleService.ts | Adds persistent title writing for Claude sessions to JSONL. |
| src/extension/chatSessions/claude/node/test/claudeProjectFolders.spec.ts | Unit tests for folder slugging and folder discovery behavior. |
| src/extension/chatSessions/claude/node/test/extractSessionId.spec.ts | Unit tests for session id extraction + beta filtering. |
| src/extension/chatSessions/claude/node/test/mockClaudeToolPermissionService.ts | Adds mock permission service for testing. |
| src/extension/chatSessions/claude/node/test/mockClaudeCodeModels.ts | Adds mock Claude model list for tests. |
| src/extension/chatSessions/claude/node/test/mockClaudeCodeSdkService.ts | Minor formatting change after relocation. |
| src/extension/chatSessions/claude/node/test/fixtures/*.jsonl | Adds Claude session fixture JSONL test data. |
| src/extension/chatSessions/claude/common/test/claudeToolPermissionRegistry.spec.ts | Unit tests for permission handler registry behavior. |
| src/extension/chatSessions/claude/vscode-node/hooks/index.ts | Adds VS Code hook self-registration entrypoint. |
| src/extension/chatSessions/claude/vscode-node/mcpServers/index.ts | Adds VS Code MCP self-registration entrypoint. |
| src/extension/chatSessions/claude/vscode-node/slashCommands/index.ts | Adds VS Code slash commands self-registration entrypoint. |
| src/extension/chatSessions/claude/vscode-node/slashCommands/claudeSlashCommandRegistry.ts | Adds slash command registry + registration helpers. |
| src/extension/chatSessions/claude/vscode-node/claudeSlashCommandService.ts | Adds service to parse/dispatch slash commands and register VS Code commands. |
| src/extension/chatSessions/claude/vscode-node/toolPermissionHandlers/index.ts | Adds VS Code permission handler self-registration entrypoint. |
mexicodxnmexico-create
added a commit
to mexicodxnmexico-create/vscode-copilot-chat
that referenced
this pull request
Feb 28, 2026
* Revert "cli - do not trust empty changes (microsoft/vscode#297975) (microsoft#4036)" (microsoft#4063) This reverts commit 420c26f. * Run command tool should include command result (microsoft#4061) * Run command tool should include command result Part of microsoft/vscode#298181 * CCR feedback * Support CAPI WebSocket connections (microsoft#4068) (microsoft#4069) * Add a maximum date of the comparison commit for the 1p repo telemetry info (microsoft#3774) * initial passes with copilot before testing * only pass on successful date * add tests for new functionality * return tooOld for all date failures * remove extra logging, info is already in telemetry and may be too noisy * fix test that used custom repo mock --------- Co-authored-by: Ian Huff <ianhuff@Mac.home> Co-authored-by: Ian Huff <ianhuff@Ians-MacBook-Pro-2.local> * 0.39.0 (microsoft#4057) * Make auto have provider affiniy (microsoft#4072) * Pipe vendor from CAPI through to chat endpoint * Adopt discussed auto mode behavior * Update src/platform/endpoint/node/test/automodeService.spec.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Hold external repo info telemetry (microsoft#4075) * Hold external repo info telemetry * Update src/extension/prompt/node/repoInfoTelemetry.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update test to reflect no external telemetry for non-internal users --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * pass in the URL for the proxy to the CLI session (microsoft#4070) * Update telemetry pkg (microsoft#4078) * Merge agents and chatsession folder (microsoft#4058) * Remove duplicated memory tool in picker (microsoft#4079) * fixes microsoft/vscode#297010 * address feedback * 🎨 Palette: Add aria-busy state to webview loading container 💡 What: Toggles `aria-busy` attribute on the `solutionsContainer` during async loading phases. 🎯 Why: To prevent screen reader users from experiencing silent, disorienting DOM changes when dynamic webview content updates. ♿ Accessibility: Improves loading state communication to assistive technologies. Co-authored-by: mexicodxnmexico-create <245638303+mexicodxnmexico-create@users.noreply.github.com> * Background - clean worktree changes cache at the end of the turn (microsoft#4083) * 🎨 Palette: Add aria-busy state to webview loading container 💡 What: Toggles `aria-busy` attribute on the `solutionsContainer` during async loading phases. 🎯 Why: To prevent screen reader users from experiencing silent, disorienting DOM changes when dynamic webview content updates. ♿ Accessibility: Improves loading state communication to assistive technologies. Co-authored-by: mexicodxnmexico-create <245638303+mexicodxnmexico-create@users.noreply.github.com> --------- Co-authored-by: Benjamin Pasero <benjamin.pasero@microsoft.com> Co-authored-by: Alex Ross <38270282+alexr00@users.noreply.github.com> Co-authored-by: Christof Marti <chrmarti@microsoft.com> Co-authored-by: Ian Huff <ian.huff@gmail.com> Co-authored-by: Ian Huff <ianhuff@Mac.home> Co-authored-by: Ian Huff <ianhuff@Ians-MacBook-Pro-2.local> Co-authored-by: Ben Villalobos <bevillal@microsoft.com> Co-authored-by: Logan Ramos <loganramos@microsoft.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Zhichao Li <57812115+zhichli@users.noreply.github.com> Co-authored-by: Aaron Munger <2019016+amunger@users.noreply.github.com> Co-authored-by: Vijay Upadya <41652029+vijayupadya@users.noreply.github.com> Co-authored-by: Don Jayamanne <don.jayamanne@outlook.com> Co-authored-by: SteVen Batten <sbatten@microsoft.com> Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com> Co-authored-by: mexicodxnmexico-create <245638303+mexicodxnmexico-create@users.noreply.github.com> Co-authored-by: Ladislau Szomoru <3372902+lszomoru@users.noreply.github.com>
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.
No description provided.