Repository navigation
Opposing user/workspace integration settings crash Python activation #1895
Description
Environment data
Reproduced on both macOS and Linux:
| macOS reproduction | Linux reproduction | |
|---|---|---|
| Python Environments | 1.38.0 | 1.39.2026100201 |
| Python extension | 2026.6.0 | 2026.7.2026100201 |
| VS Code | Insiders 1.141.0, commit e26528f6873ce188d71933ff159c633ac1a5cc8c | Insiders 1.141.0, commit ae1080a9ed1098a8b532c6cfd50977d784b29e6d |
| OS / architecture | macOS 26.7 / arm64 | Ubuntu 24.04.3, kernel 6.8.0-136-generic / aarch64 |
| Python | 3.11.9 | 3.12.3 |
| Environment manager / shell | venv / bash | venv / bash |
| Remote | None; native local desktop | None; native local desktop |
- Workspace: reproduced in a minimal single-root workspace; also observed in Linux multi-root cases.
- Regression / last known working version: unknown.
- Tests used fresh, isolated extension development/test windows. There was no debugger attached in the macOS repetitions or the three Linux repeat runs. Manual reproduction in an ordinary non-development window remains to be checked.
Repro Steps
-
Install the compatible Python and Python Environments versions above in a disposable profile.
-
Configure user settings:
{ "python.useEnvironmentsExtension": false, "workbench.enableExperiments": false, "python.experiments.enabled": false, "telemetry.telemetryLevel": "off" } -
Open a trusted single-folder Python project whose workspace settings contain:
{ "python.useEnvironmentsExtension": true } -
Open a Python file in a fresh window and allow normal activation. Do not call the integration-decision function or force extension activation as an observation probe.
-
Inspect the Python output / extension-host log and the exported APIs.
Expected behavior
The higher-precedence workspace value resolves to true. Python and Environments should agree on the activation/API contract, and Python activation should not crash.
If integration cannot initialize, that condition should be handled explicitly rather than consuming undefined exports. This is not a request to overwrite explicit settings or change VS Code configuration precedence.
Actual behavior
- The effective setting is true, and Environments is visible in Python's extension host.
- Environments exports no API.
- Python activation throws while accessing
onDidChangeEnvironmenton undefined. - Both extensions can report
isActive === truedespite exposing no API;isActivealone is not a successful-initialization check. - Reproduced in 2/2 clean macOS profiles and 4/4 clean Linux profiles. Both macOS runs and two Linux repeats were single-root.
- Clean macOS controls with user integration true and no opposing false setting activate successfully and execute Python normally.
Logs
Python output and extension-host error:
extension activation failed [TypeError: Cannot read properties of undefined (reading 'onDidChangeEnvironment')
The Linux failure additionally logged:
getActivationTelemetryProps() failed. [Error: No matching bindings found for serviceIdentifier: Symbol(IComponentAdapter)
Additional context
The behavior is consistent with mismatched gates: Python's integration decision uses the effective setting, while Environments' activation policy rejects an explicit false even when a higher-precedence true overrides it. Python's API loader then assumes extension.exports is usable and subscribes to onDidChangeEnvironment without validating the exports.
This may require coordinated changes with microsoft/vscode-python; filing here to track the integration contract.
Related but distinct: #1778 concerns default-false activation/ownership disagreement. This report concerns an explicit opposing-scope configuration that crashes Python activation.
Telemetry and both experiment controls remained off. No production telemetry or population-level causality claim is involved.
Activity
Copilot commentedon Oct 6, 2026
The agent encountered an error and was unable to start working on this issue: Please try again later, or contact support if the problem persists. (Request id: 864A:1118A0:2AFD491:3A30AD4:6AC52E37)
Copilot commentedon Oct 6, 2026
The agent encountered an error and was unable to start working on this issue: Please try again later, or contact support if the problem persists. (Request id: 864A:1118A0:2B055A7:3A3B1B3:6AC52E58)
activation: respect integration setting precedence (microsoft#1897)