Problem
At times, when I use Copilot, the session gets stuck waiting for user input from a Python environment tool, such as where to create a virtual environment or which requirements to install. This also happens in autopilot/auto-approved flows.
The immediate path is configure_python_environment invoking environment selection or creation UI after the tool call has already been approved. Tool auto-approval suppresses Chat-host approval only; it does not suppress Quick Picks or other extension-owned input UI.
Environment tools must also honor cancellation or timeout so an agent can recover if input UI is unexpectedly shown.
Proposed scope
Add an explicit execution policy to the compatibility tool, for example:
{
"resourcePath": "/workspace",
"interactionPolicy": "never"
}
Agent invocations should default to non-interactive behavior. Interactive behavior remains available only when explicitly requested (for example, "interactionPolicy": "allow").
When interaction is disallowed, the implementation must:
- never open a Quick Pick, input box, or other user-input UI;
- reuse a suitable selected environment when the choice is deterministic;
- otherwise create an environment using documented deterministic defaults;
- honor cancellation and always terminate without waiting for user input;
- return a structured, actionable failure when it cannot proceed safely.
Initial deterministic creation defaults can remain intentionally narrow: create a workspace .venv, use a suitable stable installed interpreter, and install no packages unless the existing request contract determines them unambiguously.
Expected failure categories include:
existingEnvironmentConflict;
noCompatibleInterpreter;
ambiguousEnvironment;
unsupportedCapability.
Acceptance criteria
- An auto-approved/default agent invocation never requests user input.
- The no-interaction path deterministically reuses or creates an environment, or returns a structured failure.
- Cancellation interrupts selection, creation, and backend calls without leaving the invocation pending.
- Tests assert observable no-UI behavior, successful deterministic reuse/creation, each relevant failure path, cancellation, and termination.
- The behavior works with Python Environments enabled and with the Python-extension fallback when Python Environments is disabled or unavailable.
- Unsupported requested properties are rejected explicitly rather than ignored.
Context
#26072 removes the outer tool-preparation confirmation but preserves the environment picker, so it does not address this blocking path. The broader ownership and tool-contract work is tracked by #26078.
Problem
At times, when I use Copilot, the session gets stuck waiting for user input from a Python environment tool, such as where to create a virtual environment or which requirements to install. This also happens in autopilot/auto-approved flows.
The immediate path is
configure_python_environmentinvoking environment selection or creation UI after the tool call has already been approved. Tool auto-approval suppresses Chat-host approval only; it does not suppress Quick Picks or other extension-owned input UI.Environment tools must also honor cancellation or timeout so an agent can recover if input UI is unexpectedly shown.
Proposed scope
Add an explicit execution policy to the compatibility tool, for example:
{ "resourcePath": "/workspace", "interactionPolicy": "never" }Agent invocations should default to non-interactive behavior. Interactive behavior remains available only when explicitly requested (for example,
"interactionPolicy": "allow").When interaction is disallowed, the implementation must:
Initial deterministic creation defaults can remain intentionally narrow: create a workspace
.venv, use a suitable stable installed interpreter, and install no packages unless the existing request contract determines them unambiguously.Expected failure categories include:
existingEnvironmentConflict;noCompatibleInterpreter;ambiguousEnvironment;unsupportedCapability.Acceptance criteria
Context
#26072 removes the outer tool-preparation confirmation but preserves the environment picker, so it does not address this blocking path. The broader ownership and tool-contract work is tracked by #26078.