LSP does not respect `skip-interpreter-query = true` in VSCode workspace.
Describe the Bug
This one was a bit weird to figure out. It looks pretty niche, but somewhere along the way the LSP is not respecting skip-interpreter-query = true.
Setup:
$ tree
.
├── example.py
├── pyrefly.code-workspace
└── pyrefly.toml
example.py (contents are irrelevant):
x: int = 5
x = "str"
pyrefly.code-workspace
{
"folders": [
{
"path": "."
}
],
"settings": {
"python-envs.defaultEnvManager": "ms-python.python:pyenv"
},
"extensions": {
"recommendations": [
"ms-python.python"
]
}
}
pyrefly.toml
preset = "all"
skip-interpreter-query = true
python-version = "3.14.2"
site-package-path = [
"/home/dillon/.pyenv/versions/3.14.2/lib/python3.14/site-packages"
]
python-platform = "linux"
Important, my selected Python interpreter is a deleted venv with pyenv. I replicated it with the following:
First, ensure the workspace is opened. Click on pyrefly.code-workspace and select Open Workspace in the bottom.
Next, create the to-be-deleted venv.
pyenv virtualenv deleted-venv
Then ctrl + shift + p -> Python: Select Interpreter -> deleted-venv (3.14.2).
Then delete the venv.
pyenv virtualenv-delete deleted-venv
Now when I open example.py and run ctrl + shift + p -> Pyrefly: Restart Pyrefly Client, I see the following output:
ERROR Failed to query interpreter at /home/dillon/.pyenv/versions/deleted-venv/bin/python, falling back to default Python environment settings
No such file or directory (os error 2)
This is a sign to me that pyrefly is still trying to query the Python interpreter even though I have skip-interpreter-query = true in pyrefly.toml. I am unsure if it is querying it all the time, but I would expect it not to if I provide skip-interpreter-query, python-version, python-platform and site-package-path.
Trace log:
Pyrefly_language_server_trace.log
I can see the following set.
"pythonPath": "/home/dillon/.pyenv/versions/deleted-venv/bin/python"
Sandbox Link
No response
(Only applicable for extension issues) IDE Information
Extension version 1.1.9003. See above for workspace setup.
Version: 1.131.0 (user setup) Commit: e4c7e7b1d6d060162f4aa7f8225271b67ce1df75 Date: 2026-07-28T10:51:25Z Electron: 42.7.0 ElectronBuildId: 14710161 Chromium: 148.0.7778.280 Node.js: 24.18.0 V8: 14.8.178.38-electron.0 OS: Windows_NT x64 10.0.19045
Self assigning to look into it next week tho I may not have time to fix it myself
Thanks! This doesn't result in crashing and the LSP still functions, so it doesn't strike me as urgent. Just for context, I have a Bazel setup with hermetic python toolchain, so the interpreter is somewhere in the Bazel sandbox, never in a static location. For this reason I avoid any interpreter query to simplify things.
Claiming this one — I've got a fix up in #4615 that stops the LSP from querying the interpreter when skip-interpreter-query = true is set. I'll keep this issue updated as the PR moves forward.