Repository navigation
sessions: preserve This Computer during composer restoration - #343503
Merged
Megan Rogge (meganrogge) merged 4 commits intoOct 22, 2026
Merged
Conversation
Avoid pinning the temporary Cloud default before the local provider registers during workspace restoration. Fixes #343502 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Martin Aeschlimann (aeschli)
previously approved these changes
Oct 22, 2026
Contributor
There was a problem hiding this comment.
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Copilot review overview
2 open issues
What changed in this PR
Preserves the “This Computer” automatic environment selection during new-session workspace restoration by avoiding inadvertently pinning a temporary default (e.g., Cloud) while providers are still registering.
Changes:
- Prevents persisting
_pickedEnvironmentwhen the reconciled default matches the current automatic selection. - Adds a regression test covering provider-registration order during workspace restoration.
| File | Description |
|---|---|
| src/vs/sessions/contrib/chat/browser/newChatWidget.ts | Avoids pinning an automatic environment default during workspace restoration when the computed default hasn’t actually changed. |
| src/vs/sessions/contrib/chat/test/browser/newChatWidget.test.ts | Adds a deterministic regression test for provider registration order (Cloud first, then This Computer) ensuring selection remains reactive. |
Review effort: Lite
Refresh explicit environment selections with current metadata and assert restoration outcomes without depending on observable notification counts. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Supply discovered agents and root instructions in the activation-tools fixture to fix the shared Electron CI failure. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Federico Brancasi (federicobrancasi)
approved these changes
Oct 22, 2026
Benjamin Christopher Simmonds (benibenj)
approved these changes
Oct 22, 2026
Contributor
Megan Rogge (meganrogge)
deleted the
agents/fix-session-composer-layout-bug
branch
October 22, 2026 16:25
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.


Fixes #343502
Summary
Keep an unchanged automatic environment default reactive during new-session workspace restoration. Previously, if Cloud registered before This Computer, the workspace-selection handler saved the temporary Cloud default as an explicit environment choice. The composer then stayed on Cloud after the local provider became available, including for local folders Cloud cannot serve.
Keep unchanged automatic defaults unpinned, but refresh explicit selections from the current environment list even when their ID is unchanged. This reuses the existing observable default selection and provider-change handling without adding persistence keys or provider-specific branching.
Add a deterministic regression test that restores a local folder while only Cloud is registered, then registers This Computer and checks that the selection updates without becoming pinned. The test fails on the original implementation.
CI and Review Follow-up
customizations.discoveredAgents is not iterable; the same failure reproduces locally before this fixture-only fix. Include the emptydiscoveredAgentsandadditionalRootInstructionsarrays used by neighboring fixtures. No Agent Host production behavior changes.Validation
npm run build-fast— passed after refreshing stale runtime dependencies withnpm run install-fast.npm run build-fast -- --client-only— passed../scripts/test.sh --run src/vs/sessions/contrib/chat/test/browser/newChatWidget.test.ts --run src/vs/sessions/contrib/chat/test/browser/sessionEnvironmentPicker.test.ts --run src/vs/platform/agentHost/test/node/copilotSessionLauncher.test.ts --reporter dot— passed, 331 tests.npm run eslint -- src/vs/sessions/contrib/chat/browser/newChatWidget.ts src/vs/sessions/contrib/chat/test/browser/newChatWidget.test.ts src/vs/platform/agentHost/test/node/copilotSessionLauncher.test.ts— passed.node --experimental-strip-types build/hygiene.ts src/vs/sessions/contrib/chat/browser/newChatWidget.ts src/vs/sessions/contrib/chat/test/browser/newChatWidget.test.ts src/vs/platform/agentHost/test/node/copilotSessionLauncher.test.ts— passed.npm run typecheck-client— passed.How to Test
sessions.chat.unifiedWorkspacePicker.enabled,sessions.chat.experimental.newSessionComposerLayout, andsessions.chat.experimental.environmentPicker.