sessions: improve workspace preselection and telemetry - #335480
Merged
Benjamin Christopher Simmonds (benibenj) merged 4 commits intoSep 10, 2026
Merged
Conversation
Keep editor workspace handoffs alive until the target composer is ready while preserving newer user intent. Include multi-root workspace history and record selection provenance and first-request outcomes. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot started reviewing on behalf of
Benjamin Christopher Simmonds (benibenj)
September 10, 2026 14:59
View session
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Late restoration and untracked navigation paths can let stale workspace defaults override newer user state.
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 (3)
| Severity | Finding |
|---|---|
src/vs/sessions/contrib/chat/browser/agentsWindowWorkspaceHandoff.ts — Cancellation currently depends on every user-navigation path incrementing these ad hoc counters.… |
|
src/vs/sessions/contrib/chat/browser/newChatWidget.ts — hasRestoredDraft is a one-time snapshot, but this widget can be constructed before… |
|
src/vs/sessions/contrib/sessions/browser/sessionsWindowOpenTelemetry.ts — The implementation emits selectionNotApplied after acknowledgement times out, but this… |
What changed in this PR
Improves Agents window workspace preselection, reliable handoffs, recent-workspace discovery, and related telemetry.
Changes:
- Adds editor-context workspace defaults and resilient cross-process handoffs.
- Expands recent
.code-workspaceentries with bounded reads and exclusions. - Adds selection provenance/outcome telemetry, accessibility guidance, and regression tests.
| File | Description |
|---|---|
src/vs/platform/native/common/native.ts |
Adds default-workspace handoff metadata. |
src/vs/platform/native/electron-main/nativeHostMainService.ts |
Forwards handoff metadata. |
src/vs/platform/windows/electron-main/windows.ts |
Propagates window-open workspace options. |
src/vs/platform/windows/electron-main/windowsMainService.ts |
Routes workspace defaults to Agents windows. |
src/vs/sessions/browser/parts/chatGroupView.ts |
Forwards workspace selection results. |
src/vs/sessions/browser/parts/chatGroupsView.ts |
Routes selection through active groups. |
src/vs/sessions/browser/parts/chatView.ts |
Defines selection acknowledgement contracts. |
src/vs/sessions/browser/parts/sessionView.ts |
Selects workspaces in the hosted composer. |
src/vs/sessions/common/workspaceSelection.ts |
Defines selection provenance and diagnostics. |
src/vs/sessions/contrib/chat/browser/agentsWindowOpenIntent.ts |
Classifies and resolves open arguments. |
src/vs/sessions/contrib/chat/browser/agentsWindowWorkspaceHandoff.ts |
Implements retrying workspace handoffs. |
src/vs/sessions/contrib/chat/browser/chat.contribution.ts |
Registers browser chat contributions. |
src/vs/sessions/contrib/chat/browser/chatView.ts |
Exposes workspace selection routing. |
src/vs/sessions/contrib/chat/browser/newChatInput.ts |
Exposes composer selection/input state. |
src/vs/sessions/contrib/chat/browser/newChatWidget.ts |
Applies defaults while preserving user state. |
src/vs/sessions/contrib/chat/browser/newSessionComposerService.ts |
Tracks active composer intent and requests. |
src/vs/sessions/contrib/chat/browser/newSessionFolderQuickPickAction.ts |
Adds workspace-selection actions. |
src/vs/sessions/contrib/chat/browser/sessionWorkspacePicker.ts |
Tracks selection origin and history state. |
src/vs/sessions/contrib/chat/browser/sessionsChatAccessibilityHelp.ts |
Documents workspace behavior accessibly. |
src/vs/sessions/contrib/chat/browser/voiceBridge.contribution.ts |
Reports voice-originated requests. |
src/vs/sessions/contrib/chat/electron-browser/chat.contribution.ts |
Handles IPC handoffs and telemetry lifetime. |
src/vs/sessions/contrib/chat/test/browser/agentsWindowOpenIntent.test.ts |
Tests argument classification. |
src/vs/sessions/contrib/chat/test/browser/agentsWindowWorkspaceHandoff.test.ts |
Tests handoff retries and cancellation. |
src/vs/sessions/contrib/chat/test/browser/chatView.test.ts |
Tests selection forwarding. |
src/vs/sessions/contrib/chat/test/browser/newChatWidget.fixture.ts |
Updates composer UI fixtures. |
src/vs/sessions/contrib/chat/test/browser/newChatWidget.test.ts |
Tests default-preservation behavior. |
src/vs/sessions/contrib/chat/test/browser/newSessionComposerService.test.ts |
Tests composer observation. |
src/vs/sessions/contrib/chat/test/browser/newSessionFolderQuickPickAction.test.ts |
Tests picker actions. |
src/vs/sessions/contrib/chat/test/browser/sessionWorkspacePicker.test.ts |
Tests provenance, history, and removal. |
src/vs/sessions/contrib/chat/test/electron-browser/agentsWindowWorkspaceHandoff.test.ts |
Tests Electron handoff wiring. |
src/vs/sessions/contrib/sessions/browser/sessionsActions.ts |
Records navigation and selection intent. |
src/vs/sessions/contrib/sessions/browser/sessionsWindowOpenTelemetry.ts |
Extends first-open telemetry. |
src/vs/sessions/contrib/sessions/browser/sessionsWorkspaceSelectionTelemetry.ts |
Adds selection-outcome telemetry. |
src/vs/sessions/contrib/sessions/browser/views/sessionsViewActions.ts |
Integrates workspace actions with views. |
src/vs/sessions/contrib/sessions/test/browser/sessionsActions.test.ts |
Tests session action intent tracking. |
src/vs/sessions/contrib/sessions/test/browser/sessionsWindowOpenTelemetry.test.ts |
Tests first-open telemetry snapshots. |
src/vs/sessions/contrib/sessions/test/browser/sessionsWorkspaceSelectionTelemetry.test.ts |
Tests outcome telemetry. |
src/vs/sessions/services/sessions/browser/sessionsRecentWorkspacesService.ts |
Expands and filters recent workspaces. |
src/vs/sessions/services/sessions/test/browser/sessionsRecentWorkspacesService.test.ts |
Tests bounded history expansion. |
src/vs/sessions/test/browser/sessionView.test.ts |
Tests workspace-selection forwarding. |
src/vs/workbench/contrib/chat/electron-browser/agentSessions/agentSessionsActions.ts |
Infers invoking editor workspace. |
src/vs/workbench/contrib/chat/test/electron-browser/agentSessionsActions.test.ts |
Tests editor-context inference. |
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Cancel deferred workspace handoffs from central session navigation, including repeated opens of an empty composer, without cancelling their own opening or automatic draft creation. Check live draft ownership before applying inferred defaults, wait for in-flight creation, and document the selectionNotApplied telemetry state. Add regression coverage for remote-folder navigation and late restoration. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Benjamin Christopher Simmonds (benibenj)
marked this pull request as ready for review
September 10, 2026 17:39
Contributor
📬 CODENOTIFYThe following users are being notified based on files changed in this PR: Ulugbek Abdullaev (@ulugbekna)Matched files:
Sandeep Somavarapu (@sandy081)Matched files:
|
Ladislau Szomoru (lszomoru)
previously approved these changes
Sep 10, 2026
Preserve upstream archive-nudge and Dev Container changes alongside workspace preselection provenance, acknowledgement, and draft protections. Cover combined Dev Container mode and selection-origin behavior in regression tests. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Ladislau Szomoru (lszomoru)
previously approved these changes
Sep 10, 2026
Keep upstream removal of the temporary archive-nudge debug command while retaining workspace-preselection navigation tracking. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Benjamin Christopher Simmonds (benibenj)
enabled auto-merge
September 10, 2026 20:43
roblourens
approved these changes
Sep 10, 2026
Benjamin Christopher Simmonds (benibenj)
merged commit Sep 10, 2026
5559183
into
main
53 of 54 checks passed
Benjamin Christopher Simmonds (benibenj)
deleted the
agents/workspace-preselection-telemetry
branch
September 10, 2026 21:46
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
.code-workspacefiles, preserving history ordering, deduplication, filtering, and removal behavior. Bound file reads and handle unavailable providers, malformed files, remote paths, cancellation, and timeouts.agents/firstTimeWindowOpenwith argument categories, selection provenance, readiness, handoff timing, and initial-versus-emission snapshots. Addagents/workspaceSelectionOutcometo measure default retention and first successful request, with focused regression tests and updated accessibility help.Why
The opening source alone does not distinguish an existing-session handoff from a workspace request, and the legacy preselection flag cannot explain late defaults or their origin. This improves workspace selection without overriding user intent and adds diagnostics to evaluate usefulness rather than only the percentage of populated pickers.
Reviewer notes
Validation
npm run precommit: passed for all 42 changed files.npm run transpile-client: passed.scripts\test.batwith--force-device-scale-factor=1 --reporter dot.git diff --check: passed.npm run gulp -- compile-client: blocked by the same three pre-existing Copilot SDK typing errors involvingclientInfoinCopilotClientOptionsandautoTierinCapiSessionOptions. Those source files are unchanged by this PR.Suggested manual checks