refactor: Move default cluster startup to background#709
Merged
Conversation
packages/kernel-browser-runtime/src/internal-comms/internal-connections.ts
Outdated
Show resolved
Hide resolved
packages/kernel-browser-runtime/src/internal-comms/internal-connections.ts
Outdated
Show resolved
Hide resolved
7475e4d to
83e126b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Moves the logic for conditionally starting the default subcluster from the kernel worker to the extension background. This is accomplished by means of making the
ui-connectionsmodule agnostic of where it is used and refactoring it intointernal-connections, establishing such a connection from the extension background, and using kernel RPC calls to conditionally launch the default subcluster. UI <-> kernel connections should work exactly the same as before.The default subcluster is really just for testing, and we shouldn't enshrine it in
kernel-browser-runtime, which we eventually want to use in production environments.Note
Moves default subcluster launch from the kernel worker to the extension background via a new internal comms API, replacing ui-connections and updating consumers.
packages/extension/src/background.ts):startDefaultSubcluster()usingconnectToKerneland RPC (getStatus/launchSubcluster) to conditionally start the default subcluster.drainPromiseand await it; minor init sequencing tweaks.internal-commswithconnectToKernel,receiveInternalConnections, andcomms-control-message(replacesui-connections/ui-control-command).src/index.tsandindex.test.tsto expose new APIs.receiveInternalConnections; remove first-run/default subcluster launch; keep remote comms init only.launch-subclusterresult type tonullableCapData.packages/kernel-ui/src/services/stream.ts):establishKernelConnectionwithconnectToKernel(addslabel).vitest.config.ts.Written by Cursor Bugbot for commit 83e126b. This will update automatically on new commits. Configure here.