Repository navigation
Use noninteractive environment tooling in Python agent flows - #26208
Stella Huang (StellaHuang95) wants to merge 2 commits into
Conversation
Use the compatible Python Environments private API for configuration, queries and package installation without extension-owned pickers. - Describe isolation-by-default setup and exact pythonPath selection. - Keep compatible package installation workspace-scoped so global/base protection cannot be bypassed through the legacy route. - Preserve explicit resource targeting, read-only query behavior, human interpreter pickers and missing-provider/disabled integration behavior. - Never fall back after a private operation begins. - Add scope, cancellation, compatibility and human-flow regression tests. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
🔒 Automated review in progress — Bill Schnurr (@bschnurr) is auto-reviewing this PR. |
|
GitHub cannot anchor PR review comments to unchanged lines in the diff. Falling back to a general PR comment for src/client/interpreter/configuration/interpreterSelector/commands/setInterpreter.ts:L591.
📍 src/client/interpreter/configuration/interpreterSelector/commands/setInterpreter.ts:583 [unverified] |
|
Result: 🔴 Verification detailsVerification: The relevant tests could not be fully run in the isolated environment; this review is not fully verified. Summary: [unavailable] Container verification could not start and local execution was not authorized for this PR HEAD: C:\Program Files\RedHat\Podman\podman.EXE --connection pyrx-automation failed: stderr: Error: unable to start container "7d058ee05c97cabbfa922fb77f7750cfa5103d11892c6693d280582952bc3be8": crun: open `memory.max` for writing: No such file or directory: OCI runtime attempted to invoke a command that was not found Test runs: none recorded. |
Bill Schnurr (bschnurr)
left a comment
There was a problem hiding this comment.
Approved via Review Center.
Preserve explicitly targeted workspace folders for nested environment creation and validate remote workspace URIs through the VS Code filesystem without changing ordinary interpreter selection. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
Result: 🔴 Verification detailsVerification: The relevant tests could not be fully run in the isolated environment; this review is not fully verified. Summary: [unavailable] Container verification could not start and local execution was not authorized for this PR HEAD: C:\Program Files\RedHat\Podman\podman.EXE --connection pyrx-automation failed: stderr: Error: unable to start container "5620ecaf0671a5d37dc17d64c8d5f5da91c45ccc603ef769e643db5dd56f2d5e": crun: open `memory.max` for writing: No such file or directory: OCI runtime attempted to invoke a command that was not found Test runs: none recorded. |
Use noninteractive environment tooling in Python agent flows
Summary
Route Python language-model environment tools through the compatible Python Environments
__pythonToolsv1 capability. Agents can configure, query, and install without extension-owned interpreter, folder, or package pickers while retaining VS Code's host approval controls.This is the consumer half of the paired Python Environments change. Ordinary Python command-palette workflows are not redirected to the private API.
Changes
configure_python_environment,get_python_environment_details,get_python_executable_details, andinstall_python_packages.pythonPathselection clearly. Propagate global/base installation protection from the provider.NO_WORKSPACEcannot be bypassed through global package installation. Read-only no-workspace queries retain their previous route.Compatibility and human impact
Normal selection, creation, Run Python File, debugging, and testing retain their existing entry points. Agent configuration intentionally updates the project selection that those human operations subsequently use.
Chat confirmation/result text changes, and old-provider agent calls can see a new compatibility warning, stricter resource validation, and updated explicit-selection persistence. Compatibility does not provide the new private API's isolation and process-cleanup guarantees.
Validation
main.Path/PATHassertions previously reproduced with identical failures on the pristine base; no feature-specific test failed.Known findings before merge
BaseToolcan emitfailed=falsebecause it distinguishes thrown errors rather than returned error results.Companion change
Provider PR: microsoft/vscode-python-environments#1900.
The new noninteractive behavior is used only when the provider exposes the compatible capability; there is no hard dependency on a particular extension version.