Skip to content

Add agent session project metadata - #309114

Merged
roblourens merged 3 commits into
mainfrom
roblou/session-projects
Apr 10, 2026
Merged

roblourens merged 3 commits into
mainfrom
roblou/session-projects

Conversation

@roblourens

Copy link
Copy Markdown
Member

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:

  • Plumbs optional project metadata through agent-host session summaries and provider create results.
  • Resolves Copilot session projects from git working directories, including linked worktrees pointing back to the source repo.
  • Maps local and remote agent-host project metadata into ISessionWorkspace so the sessions view can display project/source repo grouping.
  • Adds focused coverage for Copilot git project resolution and local/remote sessions provider workspace mapping.

Validation:

  • VS Code build watcher clean.
  • Focused VS Code tests: 203 passed, 0 failed.
  • npm run valid-layers-check passed.
  • Hygiene passed with only the existing TypeScript version warning.

Known follow-ups from review:

  • groupByWorkspace still groups by workspace label only, so same-name projects can collapse together.
  • Local/remote sessions providers do not yet consume notify/sessionSummaryChanged for project metadata updates.

(Written by Copilot)

Copilot AI review requested due to automatic review settings April 10, 2026 21:43

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 project info, including in create/list flows.
  • Resolve Copilot session “project” from git working directories (including linked worktrees) and propagate it into session summaries.
  • Map project into ISessionWorkspace for 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

Comment thread src/vs/platform/agentHost/node/copilot/copilotAgent.ts
Comment thread src/vs/sessions/contrib/localAgentHost/browser/localAgentHostSessionsProvider.ts Outdated
@roblourens
roblourens marked this pull request as ready for review April 10, 2026 22:24
@roblourens
roblourens enabled auto-merge (squash) April 10, 2026 22:24
@github-actions

Copy link
Copy Markdown
Contributor

Screenshot Changes

Base: 3e371922 Current: 99b15c6b

Changed (6)

chat/aiCustomizations/aiCustomizationManagementEditor/WelcomePage/Dark
Before After
before after
chat/aiCustomizations/aiCustomizationManagementEditor/WelcomePage/Light
Before After
before after
chat/aiCustomizations/aiCustomizationWelcomePages/WelcomePagePromptLaunchers/Dark
Before After
before after
chat/aiCustomizations/aiCustomizationWelcomePages/WelcomePagePromptLaunchers/Light
Before After
before after
chat/aiCustomizations/aiCustomizationWelcomePages/WelcomePageSelectorPromptLaunchers/Dark
Before After
before after
chat/aiCustomizations/aiCustomizationWelcomePages/WelcomePageSelectorPromptLaunchers/Light
Before After
before after

@roblourens
roblourens merged commit c70c886 into main Apr 10, 2026
26 checks passed
@roblourens
roblourens deleted the roblou/session-projects branch April 10, 2026 22:45
@vs-code-engineering vs-code-engineering Bot added this to the 1.116.0 milestone Apr 10, 2026
@vs-code-engineering vs-code-engineering Bot locked and limited conversation to collaborators May 25, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants