Add agent session project metadata - #309114
Merged
Merged
Conversation
(Written by Copilot)
Contributor
There was a problem hiding this comment.
Pull request overview
Adds optional project metadata to Agent Host sessions and threads it through the Agent Host protocol and VS Code sessions providers so the Sessions UI can group sessions by source project/repo (instead of by worktree/checkout folder).
Changes:
- Extend agent host session metadata and protocol session summaries with optional
projectinfo, including in create/list flows. - Resolve Copilot session “project” from git working directories (including linked worktrees) and propagate it into session summaries.
- Map
projectintoISessionWorkspacefor local/remote agent-host session providers and add targeted unit tests.
Show a summary per file
| File | Description |
|---|---|
| src/vs/sessions/README.md | Documents how agent-host project metadata maps to workspace/source repo grouping. |
| src/vs/sessions/contrib/remoteAgentHost/test/browser/remoteAgentHostSessionsProvider.test.ts | Adds coverage for project→workspace mapping and URI conversion on sessionAdded. |
| src/vs/sessions/contrib/remoteAgentHost/browser/remoteAgentHostSessionsProvider.ts | Uses project metadata to build workspace grouping; updates workspace when metadata changes. |
| src/vs/sessions/contrib/localAgentHost/test/browser/localAgentHostSessionsProvider.test.ts | Adds coverage for project→workspace mapping for local agent host sessions. |
| src/vs/sessions/contrib/localAgentHost/browser/localAgentHostSessionsProvider.ts | Uses project metadata to build workspace grouping; updates workspace when metadata changes. |
| src/vs/platform/agentHost/test/node/reducers.test.ts | Updates fixture state to include project on session summaries. |
| src/vs/platform/agentHost/test/node/protocolServerHandler.test.ts | Adds tests ensuring listSessions/createSession propagate project over the protocol. |
| src/vs/platform/agentHost/test/node/mockAgent.ts | Updates mock agents to return project metadata in list/create results. |
| src/vs/platform/agentHost/test/node/copilotGitProject.test.ts | New tests for git project resolution and repository URL parsing. |
| src/vs/platform/agentHost/test/node/agentSideEffects.test.ts | Updates tests/fixtures for new createSession result type and project propagation to sub-sessions. |
| src/vs/platform/agentHost/test/node/agentService.test.ts | Updates tests for new provider createSession return shape (destructuring { session }). |
| src/vs/platform/agentHost/test/node/agentHostStateManager.test.ts | Updates fixtures to include project on session summaries. |
| src/vs/platform/agentHost/test/common/agentSubscription.test.ts | Updates fixtures to include project on session summaries. |
| src/vs/platform/agentHost/node/protocolServerHandler.ts | Includes project when translating agent session metadata into protocol session summaries. |
| src/vs/platform/agentHost/node/copilot/copilotGitProject.ts | New utility to resolve a stable “project” from git working dirs / worktrees and fallback repo context. |
| src/vs/platform/agentHost/node/copilot/copilotAgent.ts | Adds project resolution to Copilot session listing and returns project with createSession result. |
| src/vs/platform/agentHost/node/agentSideEffects.ts | Propagates parent session project into created subagent session summary. |
| src/vs/platform/agentHost/node/agentService.ts | Adapts provider createSession to accept { session, project } and includes project in persisted summary. |
| src/vs/platform/agentHost/node/agentHostStateManager.ts | Includes project in summary change detection for notifications. |
| src/vs/platform/agentHost/electron-browser/remoteAgentHostProtocolClient.ts | Maps protocol project.uri to local (agent-host) URIs for file-based projects. |
| src/vs/platform/agentHost/common/state/sessionState.ts | Re-exports IProjectInfo from protocol state. |
| src/vs/platform/agentHost/common/state/protocol/state.ts | Adds IProjectInfo and project?: IProjectInfo to ISessionSummary. |
| src/vs/platform/agentHost/common/state/protocol/.ahp-version | Bumps synced Agent Host Protocol version. |
| src/vs/platform/agentHost/common/agentService.ts | Adds project to session metadata, introduces IAgentCreateSessionResult, and updates provider IAgent.createSession. |
Copilot's findings
- Files reviewed: 24/24 changed files
- Comments generated: 3
(Written by Copilot)
roblourens
marked this pull request as ready for review
April 10, 2026 22:24
roblourens
enabled auto-merge (squash)
April 10, 2026 22:24
joshspicer
approved these changes
Apr 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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Adds optional session project metadata to the VS Code Agent Host integration and uses it to group agent-host sessions by source project instead of worktree folder.
Summary:
projectmetadata through agent-host session summaries and provider create results.ISessionWorkspaceso the sessions view can display project/source repo grouping.Validation:
npm run valid-layers-checkpassed.Known follow-ups from review:
groupByWorkspacestill groups by workspace label only, so same-name projects can collapse together.notify/sessionSummaryChangedfor project metadata updates.(Written by Copilot)