Repository navigation
agentHost: scope changesets to chat working folders - #337263
Merged
Sandeep Somavarapu (sandy081) merged 16 commits intoSep 23, 2026
Merged
Sandeep Somavarapu (sandy081) merged 16 commits into
Sandeep Somavarapu (sandy081) merged 16 commits into
Conversation
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Chat Git-state fallback, legacy protocol handling, stale state cleanup, and serialized refresh latency remain unresolved.
Get a fresh assessment by requesting another Copilot review.
Review effort: Balanced
Findings: 4
Open (4)
What changed in this PR
Scopes Agent Host changesets and repository operations to their owning chat while retaining session-level aggregation and checkpoints.
Changes:
- Adds per-chat changeset protocol/state projection.
- Routes Git, review, and Changes view behavior through the active chat.
- Adds coverage for chat-owned changesets and repository state.
| File | Description |
|---|---|
src/vs/sessions/services/sessions/common/session.ts |
Adds chat changesets. |
src/vs/sessions/contrib/providers/agentHost/test/browser/agentHostSessionChangesets.test.ts |
Tests chat catalogue projection. |
src/vs/sessions/contrib/providers/agentHost/browser/baseAgentHostSessionsProvider.ts |
Exposes chat changesets. |
src/vs/sessions/contrib/providers/agentHost/browser/agentHostSessionChangesets.ts |
Creates chat-scoped changesets. |
src/vs/sessions/contrib/changes/test/browser/changesViewService.test.ts |
Tests active-chat switching. |
src/vs/sessions/contrib/changes/browser/changesViewService.ts |
Uses active-chat workspace and changesets. |
src/vs/platform/agentHost/test/node/agentSideEffects.test.ts |
Updates dual-scope expectations. |
src/vs/platform/agentHost/test/node/agentService.test.ts |
Updates Git refresh expectations. |
src/vs/platform/agentHost/test/node/agentHostSyncOperationHandler.test.ts |
Supplies Git-state dependency. |
src/vs/platform/agentHost/test/node/agentHostStateManager.test.ts |
Tests chat catalogue state. |
src/vs/platform/agentHost/test/node/agentHostReviewService.test.ts |
Tests chat-owned review state. |
src/vs/platform/agentHost/test/node/agentHostReviewService.integrationTest.ts |
Updates review-service setup. |
src/vs/platform/agentHost/test/node/agentHostGitStateService.test.ts |
Tests isolated chat Git state. |
src/vs/platform/agentHost/test/node/agentHostDiscardChangesOperationHandler.test.ts |
Tests post-discard refresh. |
src/vs/platform/agentHost/test/node/agentHostChangesetService.test.ts |
Tests chat-scoped computations. |
src/vs/platform/agentHost/test/node/agentHostChangesetOperationService.test.ts |
Tests chat operation filtering. |
src/vs/platform/agentHost/test/node/agentHostChangesetCoordinator.test.ts |
Tests chat refresh coordination. |
src/vs/platform/agentHost/test/common/changesetUri.test.ts |
Tests owner/session URI parsing. |
src/vs/platform/agentHost/node/chatContributions/checkpointAndChangeset/checkpointAndChangesetContribution.ts |
Publishes chat and aggregate changes. |
src/vs/platform/agentHost/node/agentSideEffects.ts |
Routes tool edits by chat. |
src/vs/platform/agentHost/node/agentService.ts |
Initializes chat changesets. |
src/vs/platform/agentHost/node/agentHostSyncOperationHandler.ts |
Syncs the owner repository. |
src/vs/platform/agentHost/node/agentHostStateManager.ts |
Stores chat catalogues. |
src/vs/platform/agentHost/node/agentHostReviewService.ts |
Separates chat review state. |
src/vs/platform/agentHost/node/agentHostGitStateService.ts |
Tracks per-chat Git state. |
src/vs/platform/agentHost/node/agentHostDiscardChangesOperationProvider.ts |
Refreshes after discard. |
src/vs/platform/agentHost/node/agentHostDiscardChangesOperationHandler.ts |
Discards in owner workspace. |
src/vs/platform/agentHost/node/agentHostCommitOperationHandler.ts |
Commits in owner repository. |
src/vs/platform/agentHost/node/agentHostCheckoutOperationHandler.ts |
Checks out in owner repository. |
src/vs/platform/agentHost/node/agentHostChangesetService.ts |
Computes chat-scoped changesets. |
src/vs/platform/agentHost/node/agentHostChangesetOperationService.ts |
Scopes and refreshes operations. |
src/vs/platform/agentHost/node/agentHostChangesetCoordinator.ts |
Coordinates chat lifecycle refreshes. |
src/vs/platform/agentHost/common/state/protocol/version/registry.ts |
Versions new chat actions. |
src/vs/platform/agentHost/common/state/protocol/common/actions.ts |
Registers chat actions. |
src/vs/platform/agentHost/common/state/protocol/channels-chat/state.ts |
Adds chat catalogue state. |
src/vs/platform/agentHost/common/state/protocol/channels-chat/reducer.ts |
Reduces new chat actions. |
src/vs/platform/agentHost/common/state/protocol/channels-chat/actions.ts |
Defines new chat actions. |
src/vs/platform/agentHost/common/state/protocol/channels-changeset/state.ts |
Documents chat ownership. |
src/vs/platform/agentHost/common/state/protocol/action-origin.generated.ts |
Updates generated action origins. |
src/vs/platform/agentHost/common/state/protocol/.ahp-version |
Updates protocol revision. |
src/vs/platform/agentHost/common/changesetUri.ts |
Separates owner and session URIs. |
src/vs/platform/agentHost/common/agentHostGitStateService.ts |
Exposes owner Git state. |
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Sandeep Somavarapu (sandy081)
force-pushed
the
sandy081/sessions-chat-changeset-ownership
branch
from
September 22, 2026 22:48
457285e to
8ca1b83
Compare
Publish independent changeset catalogues for each chat and route changes, Git state, repository operations, and review state through the owning chat workspace while preserving session-wide checkpoints, summaries, and mutation safety. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Refresh chat and aggregate Git state concurrently, prevent session Git fallback for chats, evict removed-chat Git state, and preserve the legacy session catalogue fallback when chat catalogues are unavailable. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Read focused changes, changesets, operations, review state, and status pills from the owning chat without falling back to aggregate session state. Preserve session-wide catalogues for lists, lifecycle reporting, telemetry, and draft-session repository preparation. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Make each chat the sole catalogue owner from draft creation onward while sessions retain only aggregate change summaries. Route chat-rooted subscriptions and operations through the containing session without duplicating selectable state. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Publish cumulative session changes separately from chat-owned changesets, scope picker visibility and ordering to the active chat, and keep last-turn changes accurate across peer chat databases. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Document the final split between session-wide and chat-owned selectable changesets. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Align session test doubles and catalogue expectations with the restored session-owned Session Changes entry.\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Record the expected chat changeset catalogue notification in provider AHP traffic after restoring session-owned changesets.\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sandeep Somavarapu (sandy081)
force-pushed
the
sandy081/sessions-chat-changeset-ownership
branch
from
September 23, 2026 05:32
15a99d8 to
bb82077
Compare
Share Branch Changes across chats that use the same folder while retaining checkpoint-based active-chat changes. Route Git operations, blob reads, reviews, summaries, and monitoring through the owning folder and preserve the Sessions changes UI behavior. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Restore non-Git chat changes, folder-owned operation refreshes, stable summaries and catalogues, and multi-root review-ref lifecycle behavior. Keep changes pills and session workflow operations aligned with the active chat scope. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Keep coalesced full recomputes from inheriting incremental turn state, and distinguish non-Git scopes from transient Git failures so incomplete worktree summaries are not persisted. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Resolve restored peer state before computing chat changes and preserve compatibility with legacy session-owned changeset catalogues. Avoid duplicate operation refreshes and remove the obsolete Branch computation path. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Keep Session Changes session-owned and project it into every chat while preserving chat-scoped repository and turn changesets. Remove the obsolete host-side Chat Changes production path. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sandeep Somavarapu (sandy081)
marked this pull request as ready for review
September 23, 2026 14:47
Contributor
📬 CODENOTIFYThe following users are being notified based on files changed in this PR: Kyle Cutler (@kycutler)Matched files:
Joaquín Ruales (@jruales)Matched files:
Benjamin Christopher Simmonds (@benibenj)Matched files:
|
Sandeep Somavarapu (sandy081)
enabled auto-merge
September 23, 2026 14:49
Sandeep Somavarapu (sandy081)
disabled auto-merge
September 23, 2026 14:49
Sandeep Somavarapu (sandy081)
enabled auto-merge (squash)
September 23, 2026 14:49
Remove the unused session-level changeset publication and obsolete Chat Changes identity so every chat consumes the provider-projected Session Changes catalogue. Harden the affected cross-platform and asynchronous CI tests by using platform-native paths and waiting for the observable completion conditions. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Ladislau Szomoru (lszomoru)
previously approved these changes
Sep 23, 2026
Component fixtures still mocked the removed session-level changes and changesets. Provide main-chat changes to session list fixtures and implement getChatChanges on agent feedback service mocks so the fixtures render again. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Ladislau Szomoru (lszomoru)
approved these changes
Sep 23, 2026
Sandeep Somavarapu (sandy081)
deleted the
sandy081/sessions-chat-changeset-ownership
branch
September 23, 2026 16:16
This was referenced Sep 23, 2026
This was referenced Sep 27, 2026
This was referenced Sep 29, 2026
1 of 5 tasks
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.

Summary
This PR allows chats created within an Agent Host session to use folders or worktrees that differ from the session's original workspace. Those locations become part of the containing session while repository state and operations remain scoped to each chat's effective folder set.
Chats targeting the same folders share repository state, while chats targeting different folders remain independent. The client presents the session-owned cumulative Session Changes in every chat alongside chat-scoped Branch, Uncommitted, Turn, and Compare changes, preserving the existing session-wide changes experience across restarts and peer chats.
The implementation also keeps pull request, Agent Merge, review, commit, discard, and other Git workflows aligned with the correct folder owner, while maintaining compatibility with existing and legacy sessions.
Validation
Validated with client type checking, hygiene and layer checks, focused unit suites, the Agent Host protocol integration test, and diff checks.