Skip to content

Stop macOS e2e from exhausting PTYs#825

Merged
srid merged 1 commit into
masterfrom
fix/node-pty-darwin-fd-leak
May 5, 2026
Merged

Stop macOS e2e from exhausting PTYs#825
srid merged 1 commit into
masterfrom
fix/node-pty-darwin-fd-leak

Conversation

@srid
Copy link
Copy Markdown
Member

@srid srid commented May 4, 2026

Kolu now consumes the Juspay node-pty fork branch that keeps foregroundPid and fixes the macOS /dev/ptmx leak. The previous setup patched npm node-pty@1.1.0 locally for foregroundPid, but that release leaks one PTY fd per spawn on Darwin and eventually makes e2e crash with an uncaught Napi::Error.

The dependency now resolves to juspay/node-pty#fix/darwin-pty-fd-leak, pinned in pnpm-lock.yaml as commit cc137d9. That fork branch is based on kolu/foreground-pid, cherry-picks upstream microsoft/node-pty PR #882 (af053f2), and includes built lib/ output so Kolu’s Nix package can consume it from a git tarball like it consumed the npm package. The old patches/node-pty@1.1.0.patch is no longer needed.

The foreground PID patch has also been opened upstream as microsoft/node-pty#918.

Verification

  • just fmt
  • nix develop --accept-flake-config -c pnpm --filter kolu-server typecheck
  • nix build
  • Runtime probe confirmed installed node-pty exposes foregroundPid
  • On sincereintent, with Kolu wired to the same fork commit:
    • direct fd repro: start 0, end 0 after 20 PTY spawns
    • CUCUMBER_PARALLEL=1 KOLU_TEST_VERBOSE=1 just test-quick features/codex.feature passed: 6 scenarios, 27 steps
  • Full just ci passed on commit f51883b across all expected contexts

Try it locally

nix build github:juspay/kolu/fix/node-pty-darwin-fd-leak

Generated by Codex (model gpt-5).

@srid srid force-pushed the fix/node-pty-darwin-fd-leak branch from 8adf721 to f51883b Compare May 4, 2026 23:42
@srid srid merged commit ee27b69 into master May 5, 2026
17 checks passed
@srid srid deleted the fix/node-pty-darwin-fd-leak branch May 5, 2026 01:13
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