You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Support non-interactive Python environment configuration (microsoft#25939)
Fixesmicrosoft#25940
## Summary
- Adds an optional `pythonPath` input to `configure_python_environment`,
allowing agents to select a known interpreter without opening blocking
UI.
- Validates the interpreter before changing settings, waits for the
correctly scoped active-environment event, handles an already-active
interpreter without delay, and verifies the switch before reporting
success.
- Propagates cancellation through environment selection,
virtual-environment creation waits, and environment-resolution polling.
- Fixes the virtual-environment resolution loop so it stops after its
timeout.
- Adds focused unit coverage for direct selection, invalid paths,
cancellation, already-active environments, event ordering, and
multi-root isolation.
## Validation
- Prettier
- TypeScript type-check
- ESLint
- 12 focused unit tests
---------
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copy file name to clipboardExpand all lines: package.json
+5-1Lines changed: 5 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -1593,7 +1593,7 @@
1593
1593
{
1594
1594
"name": "configure_python_environment",
1595
1595
"displayName": "Configure Python Environment",
1596
-
"modelDescription": "This tool configures a Python environment in the given workspace. ALWAYS Use this tool to set up the user's chosen environment and ALWAYS call this tool before using any other Python related tools or running any Python command in the terminal. IMPORTANT: This tool is only for Python environments (venv, virtualenv, conda, pipenv, poetry, pyenv, pixi, or any other Python environment manager). Do not use this tool for npm packages, system packages, Ruby gems, or any other non-Python dependencies.",
1596
+
"modelDescription": "This tool configures a Python environment in the given workspace. ALWAYS Use this tool to set up the user's chosen environment and ALWAYS call this tool before using any other Python related tools or running any Python command in the terminal. If you already know which Python interpreter to use (e.g. from a previous tool call or user message), pass it as 'pythonPath' to skip interactive prompts and configure the environment automatically. IMPORTANT: This tool is only for Python environments (venv, virtualenv, conda, pipenv, poetry, pyenv, pixi, or any other Python environment manager). Do not use this tool for npm packages, system packages, Ruby gems, or any other non-Python dependencies.",
"description": "The path to the Python file or workspace for which a Python Environment needs to be configured."
1612
+
},
1613
+
"pythonPath": {
1614
+
"type": "string",
1615
+
"description": "Optional absolute path to a Python interpreter to use. When provided, the environment is configured automatically without any interactive prompts. Use this to avoid blocking the session on user input."
packageList?: string[];// Added only becausewe have ability to create a virtual env with list of packages same tool within the in Python Env extension.
48
+
packageList?: string[];// Added only because we have the ability to create a virtual env with a list of packages using the same tool within the Python Env extension.
0 commit comments