fix: Node 25 native dependency compatibility (#204)#229
Closed
khaliqgant wants to merge 12 commits into
Closed
Conversation
Change .nvmrc from exact version v22.0.0 to major version 22, allowing any 22.x.x version to be used. This fixes compatibility issues for users running different minor/patch versions of Node 22. Fixes #204
- Remove node-pty from package.json dependencies - Update spawner.ts to require relay-pty binary (no fallback) - Simplify AgentWrapper type to only use RelayPtyOrchestrator This improves Node.js version compatibility by removing the native node-pty module that requires compilation for each Node version. The relay-pty Rust binary provides PTY functionality instead. Related to #204
BREAKING: Removes node-pty native module dependency and migrates all PTY functionality to use the relay-pty Rust binary. Changes: - Remove node-pty from package.json dependencies - Update spawner.ts to require relay-pty binary (no fallback) - Migrate cli-pty-runner.ts to use relay-pty via child_process.spawn - Migrate cli-auth.ts to use relay-pty for auth flows - Update onboarding.ts to remove IPty type dependency - Create wrapper-types.ts for shared event type definitions - Update imports in agent-manager.ts, persistence.ts to use wrapper-types.ts This improves Node.js version compatibility (including Node 25) by eliminating native module compilation requirements. The relay-pty Rust binary provides equivalent PTY functionality without version constraints. The relay-pty binary must be available for: - Agent spawning via Spawner - CLI authentication flows - CLI PTY runner operations Fixes #204
Add GitHub Actions workflow that tests npm install across multiple Node.js versions (18, 20, 22, 24, 25) using Docker containers. Tests include: - Full install and build in official Node images - npm pack and global installation (npm install -g) - ESM import verification - Minimal install in slim images (no build tools) This ensures the package installs correctly after removing the node-pty native module dependency. Related to #204
Replace references to node-pty with relay-pty in: - spawner.ts file header and spawn method doc - spawner.test.ts file header
The PtyWrapper class is no longer used after migrating to RelayPtyOrchestrator. Remove the file to fix TypeScript compilation errors from the missing node-pty dependency. Event types have been moved to wrapper-types.ts.
- Use local import (./dist/index.js) instead of global package import - Add npm test to verify functionality after build - Remove problematic global install test - Add fresh install test (deletes package-lock.json first) - Verify native modules compile correctly
Update test scripts in scripts/test-cli-auth/ to use relay-pty binary instead of node-pty: - ci-test-runner.ts: Migrated to child_process.spawn with relay-pty - test-oauth-flow.ts: Migrated to child_process.spawn with relay-pty - package.json: Removed node-pty dependency This completes the removal of node-pty from the entire codebase.
Remove scripts/test-pty-input.js and scripts/test-pty-input-auto.js which were manual debugging scripts that used node-pty. These are not part of the test suite and would fail without node-pty.
Add multi-stage Docker build that compiles relay-pty from source: - Stage 1: Build relay-pty using rust:1.75-slim - Stage 2: Copy binary to runtime image This fixes the CLI OAuth tests which now depend on relay-pty instead of node-pty for PTY emulation.
Add overrides for react and react-dom to resolve peer dependency conflict. drizzle-orm@0.45.1 has optional peer dependencies on React Native packages (expo-sqlite, @op-engineering/op-sqlite) that require React 19, but this web project uses React 18.3.1. The overrides tell npm to use React 18 regardless of what the optional React Native packages want. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
🤖 My Senior Dev — Analysis Complete👤 For @khaliqgant📁 Expert in View your contributor analytics → 📊 20 files reviewed • 12 need attention
🚀 Open Interactive Review →The full interface unlocks features not available in GitHub:
💬 Chat here: 📖 View all 12 personas & slash commandsYou can interact with me by mentioning In PR comments or on any line of code:
Slash commands:
AI Personas (mention to get their perspective):
For the best experience, view this PR on myseniordev.com — includes AI chat, file annotations, and interactive reviews. |
Member
Author
|
Consolidated into PR #207 - all Node compatibility fixes now in single PR |
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.
Summary
Upgrade native dependencies to support Node 25 compatibility by fixing V8 API breaking changes.
Changes
better-sqlite3: 9.4.3 → 12.6.2
esbuild: 0.24.0 → 0.27.2
package-lock.json: Regenerated via
npm installTesting
npm install+ postinstall rebuild completed successfullynpm install && npm run buildon Node 22 and Node 25 CI environmentsRelated Issues
Resolves #204 - Node 25 compatibility issues
Breaking Changes
None - backward compatible with Node 20-22