Pull Request Overview
- Opened on September 18, 2026
- Status Merged
- Commit count 2 with first commit September 18, 2026
Total Delta
Open Days
Test Delta
How long has this pull request spent in each phase of its lifecycle?
| Fraction of total time | Business days | Phase |
|---|---|---|
|
|
0.0 days | Authoring 1 commit before pull request opened for review |
|
|
0.0 days | Awaiting first review |
|
|
0.2 days | Revising work with 1 commit in response to 6 reviews that left 9 comments |
|
|
0.8 days | Merge to deploy (still awaiting deployment) |
Total time for pull request
0.2 business days
from first commit authored to merge
Still awaiting deployment
sessions: Preserve focus during background session replacement
Summary
Fix the focus race behind intermittent WSL Dev Container smoke timeouts, with follow-up diagnostics and cancellation-safe Windows CI log publication.
- Sample focus ownership before replacing a session: restore composer focus only when the replaced session view owned it. Otherwise preserve focus in Quick Input or another surface.
- Publish the replacement's focus intent atomically with the active session. Preserve normal explicit navigation.
- Add regression coverage for external focus, focused-composer replacement, explicit navigation, and atomic focus intent.
- Print bounded, redacted WSL picker/focus/notification and renderer/shared-process diagnostics to smoke task output while preserving the original failure.
- Publish Windows diagnostic logs and stop lingering test processes even on cancellation. Allow ten minutes for cancellation cleanup/publication; normal job and picker timeouts are unchanged.
Reproduction
Investigating Azure build 474825, a normal local repetition reproduced the picker timeout. Temporary focus instrumentation then captured background draft recreation calling focusSession while Connect via WSL was visible, dismissing the picker on blur before any WSL host connection started.
The original Azure attempt also hit its job timeout during post-test scanning, which skipped log publication and lost its screenshot/trace. The cancellation changes address that separate diagnostics gap.
Validation
- Regression test failed before the fix and passes afterward.
- Focused session suites after rebase: 229 passing, 2 pending.
-
npm run typecheck-client, client transpilation, smoke/automation compilation, scoped hygiene, and whitespace checks passed. - Real WSL Dev Container UI smoke: three consecutive passes before rebase, plus another pass after rebasing onto
origin/main. - Injected WSL startup failure verified diagnostic output, token redaction, and preservation of the original timeout; temporary instrumentation removed.
- Azure YAML parsed locally. Cancellation-time artifact publication has not yet been exercised in CI.
Follow-up to #336573. This branch contains one new commit on top of origin/main.
Comments Threads Pending Resolution
Resolved Comment Threads
|
547
|
|
||
|
548
|
|
||
|
549
|
|
||
| 548 |
550
|
|
|
904
|
|
||
|
905
|
|
||
|
906
|
|
||
|
907
|
|
||
|
908
|
|
|
114
|
|
||
|
116
|
|
## Copilot review overview
### 🟡 Changes recommended
Same-ID replacements can still lose composer focus, and diagnostics can read unbounded log files.
*Get a fresh assessment by requesting another Copilot review.*
**Review effort:** Balanced
**Findings:** 3
Open (3)
-
[Restore focus when a replacement keeps the same session ID](#discussion_r4044945632) · New
[Cover the other Windows smoke pipeline](#discussion_r4044945693) · New
[Bound the diagnostic log read before parsing](#discussion_r4044945733) · New
-
-
What changed in this PR
Fixes session-replacement focus races and improves Windows smoke-test failure diagnostics.
**Changes:**
- Preserves external focus while restoring focused composers after session replacement.
- Adds focus regression coverage and WSL diagnostics.
- Publishes Windows CI logs during cancellation.
| File | Description |
| ---- | ----------- |
| test/smoke/src/areas/agentsWindow/remoteDevContainerFixtures.ts | Collects WSL log diagnostics. |
| test/smoke/src/areas/agentsWindow/agentsWindow.test.ts | Dumps diagnostics on connection failure. |
| test/smoke/README.md | Documents diagnostics and cancellation behavior. |
| test/automation/src/agentsWindow.ts | Adds connection tracing and UI-state capture. |
| src/vs/sessions/services/sessions/test/browser/visibleSessions.test.ts | Tests atomic focus intent. |
| src/vs/sessions/services/sessions/test/browser/sessionsManagementService.test.ts | Tests replacement focus behavior. |
| src/vs/sessions/services/sessions/browser/visibleSessions.ts | Publishes replacement focus intent. |
| src/vs/sessions/services/sessions/browser/sessionsService.ts | Samples and applies replacement focus ownership. |
| build/azure-pipelines/win32/steps/product-build-win32-test.yml | Runs process cleanup on cancellation. |
| build/azure-pipelines/win32/product-build-win32.yml | Adds cancellation cleanup time and ...