host: fix source-mode worker startup churn (esbuild-bundle the worker entry once)#857
Open
brandonpayton wants to merge 1 commit into
Open
host: fix source-mode worker startup churn (esbuild-bundle the worker entry once)#857brandonpayton wants to merge 1 commit into
brandonpayton wants to merge 1 commit into
Conversation
Member
Author
|
Verification: |
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.
What
In source checkouts (no
host/dist/*.js), every guest process spawns a freshtsxloader for its worker entry (~500ms bootstrap each). Homebrew forks/spawns hundreds of short-lived subprocesses per command (git, curl, ruby, shells), and under that concurrency the per-worker tsx path stalls — "source-mode worker startup churn." This was a real contributor to thebrew config/doctortimeouts observed in the brew-in-Kandelo probes.Fix
NodeWorkerAdaptergains a middle load path: when running from source, bundle the.tsworker entry once with esbuild into a single cached.mjs, and launch all workers from that prebuilt bundle. Load order becomes compiled-dist → esbuild-bundle-once → tsx-fallback. Only affects source-mode dev/probe runs; production/dist is unchanged. No guest-observable behavior change, no ABI change. Addsesbuild(devDependency) and anode-worker-adapter.test.ts.Context
This is the one host fix from the brew-in-Kandelo frontier (originally on the kd-9jd worktree) not yet on main; every other scattered fix has already been independently merged. It's folded into the Track B2 brew-bootstrap re-verification branch. Opening standalone for review.
Co-Authored-By: Claude Opus 4.8 (1M context) noreply@anthropic.com