Repository navigation
fix(durable): resolve Pi host peers in managed installs - #220
Conversation
Merge the current main branch into fabric-runtime#220 and retain the shipped private SDK instead of falling back to arbitrary modules from the running Pi host. Bun-launched durable workers now delegate the SDK host to Node.js 24+, matching the declared package engine and preserving peer resolution hooks. Add a real installed-package Bun parent/worker/tool regression and document the runtime requirement.
monotykamary
left a comment
There was a problem hiding this comment.
Reconciled this PR with the pinned private SDK already shipped in 265d303. The original fallback could resolve arbitrary missing modules from the host tree and expanded NODE_PATH under Bun; that would weaken the worker's SDK isolation and duplicate startup lookup work.
76a9cff keeps the pinned SDK and uses the package's required Node.js 24+ runtime for the SDK host when Bun launches the parent. Added an installed-package Bun parent/worker/tool regression, while preserving peerless Node, conflicting-peer, missing-SDK, recovery, and recursive Fabric coverage. Documented the Node-on-PATH requirement.
Local targeted tests, typecheck, artifact guards, and fresh builds passed. Merging only after both platform checks pass.
pi-durablechildren could not start on a Pi-managed install. The worker imports Pi's packages by name, and Pi omits those peers from its extension install. Node and Bun both failed withERR_MODULE_NOT_FOUND.The fix passes the host package root to the worker as
--pi-package-dir. Node resolves misses through aregisterHooksfallback. Bun has no hooks, so the launcher setsNODE_PATHinstead, and the worker removes it before tools run. The host lookup is shared with the capture interceptor insrc/host-package.ts.New tests boot the durable worker from a peerless install under both runtimes. They fail on
mainand pass here.bun run test:changedpasses. Livepi-durableruns with tools completed under Bun and Node on macOS with Pi 1.0.4. Windows is untested.Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.