Skip to content

uv: install uv before listing Python versions - #1834

Draft
Eleanor Boyd (eleanorjboyd) wants to merge 6 commits into
microsoft:mainfrom
eleanorjboyd:agents/fix-global-create-without-uv
Draft

Eleanor Boyd (eleanorjboyd) wants to merge 6 commits into
microsoft:mainfrom
eleanorjboyd:agents/fix-global-create-without-uv

Conversation

@eleanorjboyd

@eleanorjboyd Eleanor Boyd (eleanorjboyd) commented Sep 28, 2026 •

Copy link
Copy Markdown
Member

Fixes #1832.

Depends on #1872, which retains a newly installed uv executable for the current extension-host session.

Problem

Creating a Global environment on a machine without uv failed with Failed to fetch available Python versions. The flow attempted uv python list before reaching the existing uv installation path.

User experience

When uv is missing, Global environment creation now explains why it is required and offers:

If uv installation fails, the error offers View Logs. When uv is already available, the version picker opens without an additional prompt.

This prevents a broken first-run experience without introducing lasting configuration or PATH side effects.

roblourens
roblourens previously approved these changes Sep 28, 2026
@eleanorjboyd
Eleanor Boyd (eleanorjboyd) marked this pull request as draft September 28, 2026 20:39
@eleanorjboyd
Eleanor Boyd (eleanorjboyd) force-pushed the agents/fix-global-create-without-uv branch from 9d24a27 to 699000c Compare October 6, 2026 20:24
@eleanorjboyd Eleanor Boyd (eleanorjboyd) added the bug Issue identified by VS Code Team member as probable bug label Oct 6, 2026
@eleanorjboyd
Eleanor Boyd (eleanorjboyd) marked this pull request as ready for review October 6, 2026 20:34
@eleanorjboyd
Eleanor Boyd (eleanorjboyd) force-pushed the agents/fix-global-create-without-uv branch from 699000c to d0cc27c Compare October 6, 2026 20:51
@eleanorjboyd
Eleanor Boyd (eleanorjboyd) marked this pull request as draft October 6, 2026 21:06
Global environment creation listed installable Python versions with uv
before the flow had a chance to install uv. On fresh machines this made
creation stop with a misleading version-fetch error.

Prompt for consent and ensure uv is available before version lookup.
Declining now cancels creation quietly, while successful installation
continues to version selection. Add diagnostics for version-list failures
and tests covering the complete install, lookup, and selection order.

Fixes microsoft#1832

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Rely on the modal prompt's built-in Cancel action so users are not shown two equivalent dismissal choices.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@eleanorjboyd
Eleanor Boyd (eleanorjboyd) force-pushed the agents/fix-global-create-without-uv branch from fd28cd1 to d5a8e20 Compare October 6, 2026 23:31
Treat the VS Code test host's blocked modal as cancellation in environment creation tests while continuing to surface all other errors.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.

Create Environment → Global fails with "Failed to fetch available Python versions" when uv is not installed

2 participants