continuedev / continue

⏩ Continue is the leading open-source AI code assistant. You can connect any models and any context to build custom autocomplete and chat experiences inside VS Code and JetBrains
https://docs.continue.dev/
Apache License 2.0
19.25k stars 1.66k forks source link

Messaging Audit #2958

Closed RomneyDa closed 1 day ago

RomneyDa commented 1 day ago

GUI to IDE/Core

I switched several from request to post just to be explicit that it won't await

I like this one, I think this should be the go to solution for anything that needs to be triggered by the GUI on startup: "onLoad" -> Core sends updates to GUI

These ones are probably fine since GUI should be locked down and is explicitly a GUI to Core thing

These ones should be removed or refactored to post and then listen for a post from the core rather than locking down the GUI and introducing state race conditions

E.g. apply to file already reacts to apply state updates from core, why is it awaiting this message? onComplete should be triggered in a webview listener based on apply state updates

https://github.com/continuedev/continue/blob/77d0387e4a8cbc59ef9960234fc3a238966cf5db/gui/src/components/markdown/utils/useApplyCodeBlock.ts#L34-L39

IDE to GUI

No equivalent of "invoke" or "post", so void request where relevant

Should add a "post" that doesn't allow awaiting

IDE to Core

Seems fine, only uses core.invoke which has no awaiting. I think core.send should be renamed to core.respond since it's unclear that it's responding to a specific message with an id We should get rid of ReverseMessageIde, it's only used for tests and is high maintenance

Core to IDE

Example here: send is not sending messageId so there's no point in using send, might as well just use request? https://github.com/continuedev/continue/blob/260c13bd66657b9a058a02de2fc0ed05eb085e16/core/indexing/docs/DocsService.ts

More generally we should make the messaging method naming consistent

netlify[bot] commented 1 day ago

Deploy Preview for continuedev failed. Why did it fail? →

Name Link
Latest commit f351cf3c3ef9ccb1a6c0ccb93a058e00d4f72367
Latest deploy log https://app.netlify.com/sites/continuedev/deploys/6737aed8f7b09c0008d57ec9