Skip to content

fix(worker): inherit environment preloads with explicit options - #97

Merged
steipete merged 3 commits into
mainfrom
claude/w123-worker-env-preloads
Oct 3, 2026
Merged

steipete merged 3 commits into
mainfrom
claude/w123-worker-env-preloads

Conversation

@steipete

@steipete steipete commented Oct 3, 2026 •

Copy link
Copy Markdown

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 env or execArgv re-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:

  • Initial environment matrix: 11 failures /3 passes without the fix. Later Bun preload and all eight alias regressions also fail on their preceding candidates.
  • Final exact head 3486ad3f6d4604eb67834e13d1a3ba1bcf272e63: 249 Node Worker tests and 43 Web Worker tests pass, run separately; Clippy and formatting pass.
  • Full OpenClaw 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.
  • Final committed branch P2 review: scoped-clean.
  • Both fork lanes pass on that exact head: run 37161302135.
  • Final exact-head Rust cross-target checks: 12 pass, zero failed or skipped.

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.

@steipete
steipete merged commit 72f794a into main Oct 3, 2026
10 of 11 checks passed
@steipete
steipete deleted the claude/w123-worker-env-preloads branch October 3, 2026 23:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant