Files
oh-my-pi/packages
roboomp d2be57a8f7 fix(plugins): drain subprocess pipes concurrently with proc.exited
PluginManager.install (bun install + bun update), PluginManager.uninstall,
PluginManager.#fixMissingPlugin, the legacy installer.ts install/uninstall
helpers, and generate-legacy-pi-bundled-registry.ts's formatInPlace all
called Bun.spawn with stdout/stderr piped and awaited proc.exited before
touching either stream. Once a child's output exceeded the ~64 KiB OS
pipe buffer, the child would block on write(2) while the parent blocked
on exit — a classic pipe-buffer deadlock. Even where Bun's current runtime
happens to buffer eagerly, the pattern silently leaked unbounded bytes.

Each site now starts new Response(proc.stdout).text() and stderr readers
immediately after Bun.spawn and awaits them alongside proc.exited via
Promise.all. Existing error semantics are preserved: install throws with
stderr, uninstall keeps its generic error, and formatInPlace still includes
Biome's stderr in the failure message.

Adds a regression test (plugin-install-git.test.ts) that models the
OS-pipe deadlock by holding proc.exited until both mock streams are
drained — install must read them before awaiting exit, else the test hits
its 2s Promise.race timeout.

Fixes #4230
2026-07-02 08:33:32 +00:00
..
2026-07-02 09:00:04 +02:00
2026-07-02 09:00:04 +02:00
2026-07-02 09:00:04 +02:00
2026-07-02 09:00:04 +02:00
2026-07-02 09:00:04 +02:00
2026-07-02 09:00:04 +02:00
2026-07-02 09:00:04 +02:00
2026-07-02 09:00:04 +02:00
2026-07-02 09:00:04 +02:00
2026-07-02 09:00:04 +02:00
2026-07-02 09:00:04 +02:00
2026-07-02 09:00:04 +02:00