Skip to content

Don't block on global scope during ext startup#1456

Open
eleanorjboyd wants to merge 7 commits intomicrosoft:mainfrom
eleanorjboyd:able-badger
Open

Don't block on global scope during ext startup#1456
eleanorjboyd wants to merge 7 commits intomicrosoft:mainfrom
eleanorjboyd:able-badger

Conversation

@eleanorjboyd
Copy link
Copy Markdown
Member

@eleanorjboyd eleanorjboyd commented Apr 14, 2026

When at least one workspace folder resolved successfully, don't await the global scope resolution. Run it as a background task instead of blocking startup on it.

For more than 3/4ths of slow sessions where the workspace env resolves fast (via envPreResolved), this should make the status bar update near-instantly.

Files opened outside the workspace folder wouldn't have a Python env immediately available. They would resolve moments later when the background task completes.

@eleanorjboyd eleanorjboyd changed the title Able badger Don't block on global scope during ext startup Apr 14, 2026
@eleanorjboyd eleanorjboyd requested a review from Copilot April 14, 2026 21:05
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

This PR optimizes extension startup by avoiding blocking on global-scope environment resolution when at least one workspace folder environment has already been resolved, deferring the global resolution to a background task.

Changes:

  • Defer global-scope environment selection to a background task when a workspace environment is available.
  • Add telemetry for “blocking time” of initial environment selection, including whether global scope was deferred.
  • Expand unit tests to cover error handling, deferral behavior, and additional settings-error warning paths.
Show a summary per file
File Description
src/features/interpreterSelection.ts Defers global env resolution when a workspace env is resolved; adds completion telemetry and error-handling adjustments.
src/common/telemetry/constants.ts Introduces a new telemetry event name + GDPR property mapping for env selection completion.
src/test/features/interpreterSelection.unit.test.ts Adds tests for new deferral behavior and error/warning paths in environment selection.

Copilot's findings

  • Files reviewed: 3/3 changed files
  • Comments generated: 4

Comment thread src/features/interpreterSelection.ts Outdated
Comment thread src/test/features/interpreterSelection.unit.test.ts Outdated
Comment thread src/test/features/interpreterSelection.unit.test.ts Outdated
Comment thread src/common/telemetry/constants.ts
@eleanorjboyd eleanorjboyd self-assigned this Apr 22, 2026
@eleanorjboyd eleanorjboyd added the bug Issue identified by VS Code Team member as probable bug label Apr 22, 2026
eleanorjboyd and others added 2 commits April 22, 2026 11:01
Co-authored-by: Copilot <copilot@github.com>
@eleanorjboyd eleanorjboyd marked this pull request as ready for review April 22, 2026 18:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Issue identified by VS Code Team member as probable bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants