-
Notifications
You must be signed in to change notification settings - Fork 112
Fix errors arising from kernels running on a separate extension host from other extensions #9221
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Automated tests suggest some problems with LSPs? Marking as draft while I investigate. |
OK, this is passing tests and ready for review. https://github.com/posit-dev/positron/actions/runs/17335967042 is a full suite run (felt necessary since this change is so low-level) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is working great for me and honestly I do prefer dealing with the sessionId
over searching through un-meaningful handle
entries like we did before.
Working great, like I said, for all the real examples where I was running into errors:

I also checked with the settings to force the extension affinities. ✅
@@ -590,5 +590,8 @@ | |||
"@anthropic-ai/sdk": "^0.57.0", | |||
"@github/copilot-language-server": "^1.335.0", | |||
"vscode-languageclient": "^9.0.1" | |||
} | |||
}, | |||
"extensionDependencies": [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So Assistant really does have to run in the same process, but the Jupyter extension doesn't? Do you know why? (Just for my own learning)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good question... it's because Assistant runs code with execution observers, which are one of the things that hasn't been factored to work across different extension hosts.
This change fixes some issues that arise when extensions that try to use R/Python sessions are running on a different extension host than the kernels themselves.
This fundamentally does not work today because sessions live in the extension host, and many of their methods are accessible only from that extension specific host or the main thread. It is not possible for one extension host to talk directly to another extension host.
Adding full support for this is more than I wanted to bite off, so this change is a bit of a stopgap. Here's how it works:
BaseLanguageRuntimeSession
object.package.json
'sextensionDependencies
field to declare a dependency on the kernels and/or supervisor. When VS Code is deciding which extensions to run on which host, it ensures that extensions that depend on each other are on the same host -- so we're guaranteed that the sessions in question live on our own host. That allow us to safely cast theBaseLanguageRuntimeSession
to a fullLanguageRuntimeSessiion
.This makes a for a lot of running around to get e.g. a code result:
But it's about the best we can do given the architecture today.
Addresses #9166.
Release Notes
New Features
Bug Fixes
QA Notes
We don't actually know how Julia's system got into a state where it decided to put the kernels on a different extension host. But you can make yours do the same thing by adding this to your user settings JSON:
It is possible that there are other problems in this configuration that I didn't fix. If adding the above setting gives you any trouble, check and see if it also repros on main. If it does, please file a separate issue; we think this config may be more common in the future.