Repository navigation
fix(worker): inherit environment preloads with explicit options - #97
Merged
Merged
Conversation
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.
File workers constructed with an explicit environment and
execArgv: []lost the environment's startup imports, even though Node 24.21 still applies them. This breaks startup instrumentation and hooks in worker-based applications.Select worker environment options independently from selected CLI arguments. Explicit
envorexecArgvre-reads the selected environment; fully inherited workers retain the parent's startup snapshot. Preserve raw CLI arguments through nested workers, require-before-import ordering, supported restrictions before preloads, Node's inherited-option error handling, positional parsing, and required-value aliases. Bun environment preloads support both space and equals forms.Upstream: builds on oven-sh/bun#42620 and the previously ported #40328. The upstream extension is being validated with those prerequisites. Documentation and an append-only changelog entry are included.
Validation on one direct AWS Linux c7a.8xlarge lease, using Node 24.21 as oracle:
3486ad3f6d4604eb67834e13d1a3ba1bcf272e63: 249 Node Worker tests and 43 Web Worker tests pass, run separately; Clippy and formatting pass.ui/src/e2e/model-catalog-partial-refresh.real-gateway.e2e.test.ts: Node 1/1, baseline Bun 0/1, final exact-head Bun 1/1. Runs use private 0700 HOME/state/tmp with umask 022.The initial Clippy findings were fixed and the final run passes. Advisory mordant reports three findings in untouched
bun_resolver, also present in the earlier resolver PR run. The inherited Claude issue-matching workflow failed before analysis because Anthropic auth is unconfigured; the requested independent review succeeded. No workflow or credential changes are included.Scope: this applies supported startup options; it does not implement every Node runtime flag.