Conversation
An `npm install` can pick up a node-pty prebuilt binary that is ABI-incompatible with the installed Node version (observed with Node v24.17.0; node-pty 1.1.0 has no matching prebuild). Every agent runtime spawns its AI session through node-pty, so a bad binding silently breaks the entire fleet — pty.spawn() throws "posix_spawnp failed" for every command while the daemon looks healthy (Telegram, crons, and command registration bypass node-pty). Add a postinstall script that spawns a trivial command through node-pty in a fresh subprocess and rebuilds from source if it fails. Never hard-fails the install — if no compiler is available, it warns and leaves the existing prebuild in place. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Owner
|
Thanks for this. We have got it and it is in front of a human, not a queue. We will reply here with a real answer, not a status. If you do not hear from us within a couple of days, that is our failure and you should say so loudly in this thread. |
Owner
|
Thanks - this addresses a failure class we've hit ourselves (postinstall exit 0 with a broken native module is real), so this is wanted. Verdict: adopt after rebase. Two asks:
Thanks for contributing! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Contribution
Type: bug fix
Problem:
An
npm installcan pick up a node-pty prebuilt binary that is ABI-incompatible with the installed Node version (observed with Node v24.17.0; node-pty 1.1.0 has no matching prebuild). Every agent runtime spawns its AI session through node-pty, so a bad binding silently breaks the entire fleet:pty.spawn()throwsposix_spawnp failedfor every command while the daemon looks healthy (Telegram polling, cron scheduling, and command registration bypass node-pty). The breakage goes unnoticed until an agent's crash counter trips its daily halt.Proposed change:
Add a
postinstallscript (scripts/verify-node-pty.js) that spawns a trivial command through node-pty in a fresh subprocess and rebuilds from source if it fails. Never hard-fails the install — if no compiler is available, it warns and leaves the existing prebuild in place. Benefits any member running on a Node version that outpaces node-pty's prebuild matrix.Intended Scope
Public base commit:
afba07747d304b7cfbf3b22d0265d2c3f9df7eb4Head commit:
06dc5c70598a5f7de548d3798de48ffee0d9ce20upstream/main...HEADdiff, not onlyHEAD~1or the latest commit.Organization-Specific And Human Data
What organization-specific source material did this work start from?
A production incident where an
npm installpicked up an ABI-incompatible node-pty prebuild, silently disabling all agent sessions. The fix is generic — no org-specific data was used.What did you scrub or replace, and in which files?
Nothing to scrub. The script references only generic node-pty behavior and standard npm tooling. The incident date in the comment header is retained as context for the fix.
Persona privacy inventory:
Not an agent/persona contribution.
555-0100through555-0199range; any phone-shaped value outside that range has been removed.Do We Want To Own It?
1. Who can this bite?
Any AscendOps member running a Node version newer than what node-pty ships prebuilds for. The triggering condition is:
npm installdownloads a prebuild that doesn't match the running Node ABI, which happens when Node releases outpace node-pty's prebuild CI matrix. This is not org-specific — it affects every installation on the affected Node version.2. Why in the next 90 days?
Node v24 was released recently and node-pty 1.1.0 doesn't ship a matching prebuild. Anyone installing on v24 hits this silently. The fix is 75 lines and runs only at install time. Without it, the failure mode is a fleet that looks healthy but has zero working agent sessions.
3. What does it collide with?
The
fix/bypass-fresh-evidencebranch adds Claude preflight and PTY startup hardening. Those catch problems at spawn time; this catches them at install time. The two are complementary, not conflicting — they cover different failure windows. Searched: all open PRs,scripts/directory,package.jsonscripts field,node-ptyreferences insrc/.4. What does ownership cost forever?
Minimal. The script is 75 lines of plain Node.js with no external dependencies. It runs once at
npm installand exits. Maintenance cost: if node-pty changes its API (unlikely —pty.spawnis its core interface), the smoke test line needs updating. No security surface (reads nothing, writes nothing, spawns onlyecho). Failure mode is graceful — warns and exits 0 if rebuild fails.noogalabs/ascendops; it does not modify or request access to any private/production repository.Mechanical Verification
npm run typecheckpasses.npm run buildpasses.npm testpasses.node scripts/skill-drift-check.mjs --tier cipasses.git diff --check upstream/main...HEADpasses.Note on regression tests: The script itself is a smoke test — it verifies node-pty works by spawning a real command. A unit test would need to mock node-pty failure at the native binding level, which would test the mock rather than the binding. The postinstall hook's behavior is verified by
npm installon any system where node-pty's prebuild is incompatible. If a synthetic test fixture is preferred, happy to add one that exercises the script's exit-code behavior.External Surface And Rollback
External services, APIs, scopes, environment variables, and permissions:
None. The script uses only Node.js builtins (
child_process.spawnSync) and the locally installednode-ptypackage. No network calls, no environment variable reads, no file writes.Failure behavior and rollback plan:
The script never hard-fails. If node-pty's binding is broken AND a source rebuild is not possible, it warns to stderr and exits 0 — install completes normally, same as today's behavior. Rollback: remove the
postinstallline frompackage.jsonand deletescripts/verify-node-pty.js.Security-sensitive or destructive paths touched:
None. The script spawns
/bin/echo ok(orcmd.exe /c okon Windows) through node-pty and optionally runsnpm rebuild node-pty --build-from-source. No auth, tokens, messaging, deploys, deletes, or watchdog logic.