fix(kimi-code): ship node-pty natives in the packaged CLI - #3353
fix(kimi-code): ship node-pty natives in the packaged CLI#3353astraltrekkin wants to merge 2 commits into
Conversation
Co-authored-by: Cursor <cursoragent@cursor.com>
🦋 Changeset detectedLatest commit: e588144 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 600414f779
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| 'linux-arm64': [], | ||
| 'linux-x64': [], |
There was a problem hiding this comment.
Include the Linux node-pty native payload
For both released Linux targets, these empty lists cause collectPackageFiles to extract only node-pty's JS and package metadata: js-and-native-file does not enable native auto-scanning, and the recursive collector explicitly skips .node files. Node-pty requires both prebuilds/<linux-arch>/pty.node and the executable spawn-helper on Linux, as also documented in scripts/fix-node-pty-perms.mjs:3-9, so creating a web terminal from either packaged Linux binary will still fail when it loads or spawns the PTY. Add the Linux prebuild paths and mark spawn-helper executable just as for Darwin.
Useful? React with 👍 / 👎.
Linux packaged builds omitted pty.node and spawn-helper, so web terminals failed the same way as before the Darwin/Windows payload fix. Co-authored-by: Cursor <cursoragent@cursor.com>
Related Issue
Resolve #3326
Problem
See linked issue. Starting
kimi webfrom the packaged single-file CLI and creating a terminal (POST /api/v1/sessions/{session_id}/terminals) fails with50001/ERR_UNKNOWN_BUILTIN_MODULEbecausenode-ptyprebuilds are not shipped as native assets and the SEA loader cannot resolveprebuilds/<target>/*.node.What changed
Register
node-ptyin the native-asset set (per-target.nodefiles, darwinspawn-helperat0755, Windows sidecars plusconoutSocketWorker.js). Extract the package JS next to those files and load it through the existing native-package cache sorequire(),spawn-helper, and the Windows workerWorker(__dirname/…)paths resolve on disk. Rewriteawait import('node-pty')in the SEA bundle to that loader.Checklist
/approve).gen-changesetsskill, or this PR needs no changeset.gen-docsskill, or this PR needs no doc update.