Skip to content

fix(pty): update Node to 24.21 for upstream Linux EOF fix (VC-639) - #751

Merged
hussainph merged 3 commits into
mainfrom
volli/VC-639-pty-shell-s-final-output-sometimes-missing-befor
Oct 5, 2026
Merged

hussainph merged 3 commits into
mainfrom
volli/VC-639-pty-shell-s-final-output-sometimes-missing-befor

Conversation

@hussainph

@hussainph hussainph commented Oct 5, 2026 •

Copy link
Copy Markdown
Owner

VC-639 — use the released libuv fix by updating Node

The missing bye-8 is a Linux PTY premature-EOF bug below node-pty, not an exit-ordering defect in our supervisor. The repository pinned Node 24.15.0 / libuv 1.51.0 for the plain-Node host/CI lane. libuv's fix 2e2114ed / #4997 for #4992 shipped in libuv 1.52.0; Node 24.16.0+ includes libuv 1.52.1 (nodejs/node#61829). Electron 44 already includes this fix.

Changes

  • Pin .nvmrc and the host image to 24.21.0, the newest 24.x release in Node's release index. Update the image's tag and verified multi-arch digest together: sha256:0e0ff40c39bc087845bfb27465a0df4ea419520094bc35842ff83dd8cbe6f9b6.
  • Raise the supported floor to ^24.16.0, retaining the repository's caret/24.x convention. Keep engineStrict, development diagnostics, README, contributing/build docs, and host packaging docs consistent. Workflows already use .nvmrc or the root manifest; no explicit workflow version needs changing. hostd packages that exact Node binary.
  • Keep the real-shell 200kB output + UTF-8 tail before exit regression and the original bye-8 assertion unchanged.
  • Remove the node-pty patch entirely, its guard-only tests and registration. Regenerated lockfile and desktop notices are byte-identical to the original baseline; node-pty is pristine 1.1.0. No supervisor, session-runtime or hostd composition changes.

Why not carry a patch?

The earlier before-EOF drain patch was independently verified as correct, but it overrode tty.ReadStream internals to work around a failure already fixed in a released runtime. Updating the lagging Node pin is smaller, upstream-owned and removes that maintenance burden. Waiting above node-pty was disproven and is not shipped either.

Before / after evidence

The independent review (.scratch/vc639-verify/review.md in the supervising checkout) measured pristine node-pty on native Linux arm64:

Runtime Real-shell lost tails Original attached-client assertion
Node 24.15.0, libuv 1.51.0 24/5,000 2/320
Node 24.21.0, libuv 1.52.1 0/25,000 0/320

Our additional original-assertion stress on Linux x64 emulation, Node 24.21.0 / libuv 1.52.1 with pristine node-pty: 500/500 passed, zero failures. Two 250-case test files, 2-CPU ceiling, configured maxWorkers=$VOLLI_CONCURRENCY_HINT (4 during this run). The harness asserted there was no installed linuxPtyEof.js, rebuilt node-pty from source under Node 24.21.0 (ABI 137), probed it, and successfully loaded/queried better-sqlite3 (SELECT 1). Scratch commands/results: .scratch/vc639/linux-x64/run.sh, container.sh, generate.mjs, logs/native-node21-normal-results.json; command: ITERATIONS=250 CPUS=2 bash .scratch/vc639/linux-x64/run.sh native-node21-normal.

Checks for this final approach

  • vp check — pass.
  • vp run --filter @volli/host-core typecheck — pass.
  • (cd packages/host-core && vp test run src/pty src/db-open-failure.test.ts --maxWorkers=$VOLLI_CONCURRENCY_HINT) — 116 passed (102 PTY + 14 diagnostics).
  • (cd apps/desktop && vp test run src/main/pty.test.ts --maxWorkers=$VOLLI_CONCURRENCY_HINT) — 224 passed.
  • vp run --filter @volli/docs check — 0 errors/warnings/hints.
  • Node preflight self-test/current runtime — pass; explicit floor probe rejects 24.15 and 25.x, accepts 24.16 and 24.21.
  • Frozen offline install, pristine node-pty probe, notices self-test/check, git diff --check — pass. Local macOS checks used supported Node 24.18.0; new exact runtime/native-artifact verification is Linux stress and CI.

Final-head CI green on 009fe77948b1c2af5c20a5283f92bbabf20653d3: run 37276292647. gh pr checks 751 --watch --fail-fast exited 0; CI gate, Test (packages), all desktop shards/coverage and gating smoke lanes, Check + Build, and Build (host container) passed. Host-core in Linux CI: 4,181 passed, 4 platform-specific skipped; protected statements/branches/functions/lines 100%. The host image/deploy built pristine node-pty from source; native installation completed for better-sqlite3 (bundled N-API prebuild). Both pre-archive and shipped-artifact probes returned {"ok":true,"node":"24.21.0","better-sqlite3":"3.53.4","node-pty":"spawned /bin/sh",...}, and the artifact boot passed. The prior patch-head result is not used as verification of this revision.

Residual upstream case

libuv#5165 fixes a rarer remaining PTY EOF case in libuv 1.53.0. No released Node currently includes it; nodejs/node#66282 is open. It did not reproduce in the independent 25,000-run Node 24.21 sample. Revisit the runtime pin once a Node release ships libuv ≥1.53.0; this PR does not claim to fix that residual case or add a defensive patch for it.

Owner reviews/merges; no auto-merge.

@coderabbitai

coderabbitai Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 91046a30-de26-4742-b845-0c875b744123
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@hussainph hussainph changed the title fix(pty): preserve Linux shell tail before premature EOF (VC-639) fix(pty): update Node to 24.21 for upstream Linux EOF fix (VC-639) Oct 5, 2026
@hussainph
hussainph merged commit 3abede2 into main Oct 5, 2026
17 checks passed
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