Preserve customization roots during provisional sessions - #334124
Merged
Vritant Bhardwaj (vritant24) merged 3 commits intoSep 2, 2026
Merged
Preserve customization roots during provisional sessions#334124Vritant Bhardwaj (vritant24) merged 3 commits into
Vritant Bhardwaj (vritant24) merged 3 commits into
Conversation
Use the provisional session's creation roots until the Agent Host session snapshot arrives so first-request migration hints assess the correct scope. Confirmed session state remains authoritative once hydrated. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot started reviewing on behalf of
Vritant Bhardwaj (vritant24)
September 2, 2026 21:41
View session
Vritant Bhardwaj (vritant24)
enabled auto-merge
September 2, 2026 21:44
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Subscription errors can incorrectly restore stale provisional roots, and the precedence behavior lacks direct coverage.
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 (2)
| Severity | Finding |
|---|---|
src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostCustomizationService.ts — _readSessionState also returns undefined when the subscription is in an error state, even if… |
|
src/vs/workbench/contrib/chat/test/browser/agentSessions/agentHostUntitledProvisionalSessionService.test.ts — This test only covers the new provisional-service getter, not the behavior this PR changes in… |
What changed in this PR
Preserves provisional Agent Host workspace roots so customization resolution works before session-state hydration.
Changes:
- Exposes provisional-generation working directories.
- Uses them as a pre-snapshot fallback.
- Tests root retention after session rebinding.
| File | Description |
|---|---|
agentHostUntitledProvisionalSessionService.ts |
Exposes provisional roots. |
agentHostCustomizationService.ts |
Adds provisional-root fallback. |
agentHostUntitledProvisionalSessionService.test.ts |
Tests rebinding behavior. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Use the last confirmed session snapshot when a subscription errors so provisional roots are only used before session state is hydrated. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Dmitriy Vasyura (dmitrivMS)
approved these changes
Sep 2, 2026
Vritant Bhardwaj (vritant24)
deleted the
agents/preserve-provisional-customization-roots
branch
September 2, 2026 23:39
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
Why
A provisional session already has an exact working-directory set, but customization consumers previously observed an empty set until Agent Host published session state. During that window, workspace-scoped customizations could be classified outside the active scope and omitted from first-request experiences.
The fallback reads the roots from the generation that matches the provisional session's desired state, including after the untitled session is rebound to its real session URI.