coder / code-server

VS Code in the browser
https://coder.com
MIT License
67.27k stars 5.51k forks source link

[Feat]: Add setting to keep extension host alive #6643

Closed heatherbuletti closed 1 month ago

heatherbuletti commented 6 months ago

What is your suggestion?

Add a setting to keep the extension host alive for a configurable amount of time.

Why do you want this feature?

We are using extensions that rely on the code server extension host to be running even when the IDE is not open in the browser. The current behavior seems to be that the extension host terminates after a few minutes of closing the IDE, but we would like to be able to keep it alive for hours or indefinitely.

Are there any workarounds to get this functionality today?

Not that we're aware of, but please let us know if we missed something!

Are you interested in submitting a PR for this?

Probably not, sorry!

code-asher commented 6 months ago

This is a great idea, but I think this would be too much of a rework to be maintainable as a patch here in code-server.

I think keeping the extension host alive means serializing state and sending that all back to the client so it can resume the connection to an already-running host, and there is also the question of how to handle multiple windows open at the same time (currently they all just get their own extension host). Or, some other kind of rearchitecturing.

It would be a better experience (and it would fix several bugs with deactivating extensions and debugging) but that work will need to go upstream, I think. https://github.com/microsoft/vscode

As for workarounds, if you need some kind of persistent process you might have to spawn a new process and detach it so it will not get killed when the extension host dies, and then communicate with it through some kind of IPC, maybe a socket or something.

heatherbuletti commented 6 months ago

thanks for the reply!! the specific issue we're running into is the fact that multiple windows get different extension hosts, but architecturally it makes sense that it is not feasible to address this in code-server without major changes. i appreciate your consideration either way!

code-asher commented 1 month ago

Another issue asking for the same thing where I go into more detail: https://github.com/coder/code-server/issues/6836

Closing both for now though, would be cool to see this happen upstream though.