Skip to content

Fix dev build: externalize ssh2 native deps#2

Merged
khaliqgant merged 1 commit into
mainfrom
fix/externalize-ssh2-native
May 20, 2026
Merged

Fix dev build: externalize ssh2 native deps#2
khaliqgant merged 1 commit into
mainfrom
fix/externalize-ssh2-native

Conversation

@khaliqgant

Copy link
Copy Markdown
Member

Summary

  • npm run dev failed with Could not resolve "../build/Release/cpufeatures.node" because @agent-relay/sdk is bundled into the main build and pulled ssh2 (and its native cpu-features.node) along with it.
  • Add ssh2 and cpu-features to rollupOptions.external so they load from node_modules at runtime, matching how ws is already handled.

Test plan

  • npx electron-vite build succeeds
  • npm run dev launches the app without the cpufeatures resolve error

🤖 Generated with Claude Code

The @agent-relay/sdk is bundled into main, which pulled ssh2 and its
native cpu-features.node into the Vite SSR build and broke dev. Mark
both as external so they load from node_modules at runtime.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented May 20, 2026

Copy link
Copy Markdown

Review Change Stack

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Free

Run ID: a6b337a0-3231-48c5-9d36-174f4f4e756f

📥 Commits

Reviewing files that changed from the base of the PR and between e306b30 and 1caa222.

📒 Files selected for processing (1)
  • electron.vite.config.ts

📝 Walkthrough

Walkthrough

The Electron/Vite build configuration is updated to expand the Rollup external dependencies list for the main process. The external array grows from ['ws'] to ['ws', 'ssh2', 'cpu-features'], ensuring these modules are not bundled and remain as external dependencies at runtime.

Changes

Build Configuration Update

Layer / File(s) Summary
Rollup external dependencies expansion
electron.vite.config.ts
External dependencies for the Electron main build are expanded from ['ws'] to ['ws', 'ssh2', 'cpu-features'] to prevent bundling of ssh2 and cpu-features modules.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐰 A rabbit hops through configs bright,
Adding modules to the external sight,
ssh2 and cpu-features now run free,
No bundling chains for them to see! 🚀


Note

🎁 Summarized by CodeRabbit Free

Your organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Pro by visiting https://app.coderabbit.ai/login.

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

@khaliqgant khaliqgant requested a review from willwashburn May 20, 2026 07:19

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 1 additional finding.

Open in Devin Review

@khaliqgant khaliqgant merged commit b1915d1 into main May 20, 2026
3 checks passed
miyaontherelay added a commit that referenced this pull request Jun 8, 2026
Fix #2: chunks that arrived mid-IPC stay in pending until the next rAF.
If we capture writtenChunks before that flush, the subsequent subscribe
replays them on top of the snapshot we just wrote — duplicate text.

Expose flushPtyChunksNow(key) that cancels the pending rAF and runs
flushPending synchronously, then call it in attachAndSeed right before
reading getPtyChunks(key).length.
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.

2 participants