Skip to content

Preserve customization roots during provisional sessions - #334124

Merged
Vritant Bhardwaj (vritant24) merged 3 commits into
mainfrom
agents/preserve-provisional-customization-roots
Sep 2, 2026
Merged

Preserve customization roots during provisional sessions#334124
Vritant Bhardwaj (vritant24) merged 3 commits into
mainfrom
agents/preserve-provisional-customization-roots

Conversation

@vritant24

@vritant24 Vritant Bhardwaj (vritant24) commented Sep 2, 2026

Copy link
Copy Markdown
Member

Summary

  • Exposes the working directories used to create the current provisional Agent Host generation.
  • Uses those roots for customization resolution before the first session-state snapshot arrives.
  • Keeps hydrated Agent Host session state authoritative once it is available.

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.

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 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.

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 Medium severity · 1 Low severity

New issues introduced by this change (2)
Severity Finding
Medium severity src/​vs/​workbench/​contrib/​chat/​browser/​agentSessions/​agentHost/​agentHostCustomizationService.ts_readSessionState also returns undefined when the subscription is in an error state, even if…
Low severity 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>
@vritant24
Vritant Bhardwaj (vritant24) merged commit a285bdc into main Sep 2, 2026
40 checks passed
@vritant24
Vritant Bhardwaj (vritant24) deleted the agents/preserve-provisional-customization-roots branch September 2, 2026 23:39
@vs-code-engineering vs-code-engineering Bot added this to the 1.137.0 milestone Sep 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants