Skip to content

fix(browser): survive a parent that closes the std pipes - #80

Merged
atemerev merged 1 commit into
mainfrom
fix/browser-epipe-guard
Jul 30, 2026
Merged

fix(browser): survive a parent that closes the std pipes#80
atemerev merged 1 commit into
mainfrom
fix/browser-epipe-guard

Conversation

@atemerev

Copy link
Copy Markdown
Collaborator

Summary

The open daemon dies with an unhandled write EPIPE when its parent closes the std pipes after reading the ready line. Trigger found in the wild: the Lethe desktop runtime (lethe 0.28.0) drops the daemon stderr pipe once ready, the linkedin profile is sealed read-only, and linkedin.com fires dozens of telemetry POSTs on load — the access-guard logs each blocked request to stderr, the first burst hits the closed pipe, and the session dies seconds after a successful navigate. Signature: open ready → first navigate ok → every later call session unreachable: ECONNREFUSED, respawn loop.

Fix: swallow error events on process.stdout/process.stderr in the CLI entry. Losing diagnostics must never cost the session.

Verification

Python harness mimicking the host (spawn open --name linkedin, read ready, close stderr, navigate to linkedin.com): unpatched 7.6.0 daemon exits rc=1 within 1s of navigate; patched daemon survives, serves page-text, and close reseals cleanly.

The complementary host-side fix (drain stderr for the daemon lifetime) lands in lethe separately.

🤖 Generated with Claude Code

The open daemon writes diagnostics to stderr for its whole lifetime — the
read-only access-guard logs every blocked request there, and a busy site
(LinkedIn fires dozens of telemetry POSTs seconds after load) produces a
burst of them. A host that closes the pipe after reading the ready line
turned that first burst into an unhandled write EPIPE that killed the live
session: open reported ready, the first navigate succeeded, and every call
after it got session unreachable ECONNREFUSED.

Swallow error events on process.stdout/stderr in the CLI entry. Losing
diagnostics must never cost the session.
@atemerev
atemerev merged commit 05abd08 into main Jul 30, 2026
4 checks passed
@atemerev
atemerev deleted the fix/browser-epipe-guard branch July 30, 2026 17:51
@github-actions github-actions Bot mentioned this pull request Jul 30, 2026
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