Agents - enable switching branches for folder sessions - #334354
Merged
Ladislau Szomoru (lszomoru) merged 4 commits intoSep 3, 2026
Conversation
Ladislau Szomoru (lszomoru)
enabled auto-merge (squash)
September 3, 2026 19:15
Copilot started reviewing on behalf of
Ladislau Szomoru (lszomoru)
September 3, 2026 19:16
View session
Contributor
📬 CODENOTIFYThe following users are being notified based on files changed in this PR: Sandeep Somavarapu (@sandy081)Matched files:
|
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Operation ordering, draft lifecycle gating, and checkout failure feedback have unresolved correctness and accessibility issues.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review tier: Balanced
Findings: 1
New issues introduced by this change (4)
| Severity | Finding |
|---|---|
src/vs/platform/agentHost/node/agentHostChangesetOperationService.ts — An identical request is always joined to the older in-flight promise, even when a different request… |
|
src/vs/platform/agentHost/node/agentHostCheckoutOperationProvider.ts — Creating is not equivalent to an unused draft: the first turn can start and finish before… |
|
src/vs/sessions/contrib/providers/agentHost/browser/agentHostSessionConfigPicker.ts — Folder checkout can reject with actionable errors such as a dirty working tree or a missing branch,… |
|
src/vs/sessions/contrib/providers/agentHost/browser/agentHostSessionConfigPicker.ts — This fire-and-forget checkout can fail after the mobile sheet has synchronously marked the tapped… |
What changed in this PR
Enables branch switching for draft folder-based Agent Host sessions while coordinating configuration, checkout operations, and first-send readiness.
Changes:
- Adds validated Git checkout operations and protocol metadata.
- Makes folder-session branches selectable across desktop and mobile pickers.
- Serializes configuration and checkout operations with expanded tests.
| File | Description |
|---|---|
src/vs/sessions/services/sessions/common/session.ts |
Adds operation metadata. |
src/vs/sessions/contrib/providers/agentHost/test/browser/localAgentHostSessionsProvider.test.ts |
Tests configuration serialization. |
src/vs/sessions/contrib/providers/agentHost/test/browser/agentHostSessionChangesets.test.ts |
Tests disconnected invocation. |
src/vs/sessions/contrib/providers/agentHost/test/browser/agentHost/agentHostSessionConfigPicker.test.ts |
Tests folder branch selection. |
src/vs/sessions/contrib/providers/agentHost/browser/baseAgentHostSessionsProvider.ts |
Coordinates draft configuration operations. |
src/vs/sessions/contrib/providers/agentHost/browser/agentHostSessionConfigPicker.ts |
Performs branch checkout from pickers. |
src/vs/sessions/contrib/providers/agentHost/browser/agentHostSessionChangesets.ts |
Forwards operation metadata. |
src/vs/sessions/contrib/changes/test/browser/changesViewService.test.ts |
Tests checkout visibility filtering. |
src/vs/sessions/contrib/changes/test/browser/changesActions.test.ts |
Tests hidden checkout actions. |
src/vs/sessions/contrib/changes/browser/changesViewService.ts |
Hides internal checkout operations. |
src/vs/sessions/contrib/changes/browser/changesActions.ts |
Excludes checkout actions from menus. |
src/vs/sessions/common/agentHostSessionsProvider.ts |
Adds draft-operation tracking API. |
src/vs/platform/agentHost/test/node/shared/worktreeIsolation.test.ts |
Tests folder branch configuration. |
src/vs/platform/agentHost/test/node/copilotGitProject.test.ts |
Updates Git test stub. |
src/vs/platform/agentHost/test/node/copilotAgent.test.ts |
Updates Git test stub. |
src/vs/platform/agentHost/test/node/agentService.test.ts |
Updates configuration expectations. |
src/vs/platform/agentHost/test/node/agentHostPullRequestOperationHandler.test.ts |
Updates Git test stub. |
src/vs/platform/agentHost/test/node/agentHostGitService.integrationTest.ts |
Tests real branch checkout. |
src/vs/platform/agentHost/test/node/agentHostDiscardChangesOperationHandler.test.ts |
Updates Git test stub. |
src/vs/platform/agentHost/test/node/agentHostCommitOperationHandler.test.ts |
Updates Git test stub. |
src/vs/platform/agentHost/test/node/agentHostCheckoutOperationProvider.test.ts |
Tests checkout advertisement. |
src/vs/platform/agentHost/test/node/agentHostCheckoutOperationHandler.test.ts |
Tests checkout validation. |
src/vs/platform/agentHost/test/node/agentHostChangesetOperationService.test.ts |
Tests metadata serialization. |
src/vs/platform/agentHost/test/common/sessionTestHelpers.ts |
Updates shared Git stub. |
src/vs/platform/agentHost/node/shared/worktreeIsolation.ts |
Makes folder branches selectable. |
src/vs/platform/agentHost/node/agentHostGitService.ts |
Implements Git checkout. |
src/vs/platform/agentHost/node/agentHostContributions.ts |
Registers checkout contribution. |
src/vs/platform/agentHost/node/agentHostCheckoutOperationProvider.ts |
Advertises checkout capability. |
src/vs/platform/agentHost/node/agentHostCheckoutOperationHandler.ts |
Validates and executes checkout. |
src/vs/platform/agentHost/node/agentHostChangesetOperationService.ts |
Serializes operation lanes. |
src/vs/platform/agentHost/common/meta/agentCheckoutOperationMeta.ts |
Encodes checkout metadata. |
src/vs/platform/agentHost/common/agentHostGitService.ts |
Extends the Git service API. |
src/vs/platform/agentHost/common/agentHostChangesetOperationService.ts |
Defines checkout operation ID. |
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Paul (pwang347)
approved these changes
Sep 3, 2026
Anthony Kim (anthonykim1)
approved these changes
Sep 3, 2026
Ladislau Szomoru (lszomoru)
deleted the
lszomoru/agents-checkout-operation
branch
September 3, 2026 22:17
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.