Skip to content

fix: stop requiring node-pty in the Windows desktop package - #413

Merged
elkaix merged 2 commits into
mainfrom
fix/desktop-drop-node-pty
Nov 16, 2026
Merged

elkaix merged 2 commits into
mainfrom
fix/desktop-drop-node-pty

Conversation

@elkaix

@elkaix elkaix commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Requirement or Bug

Desktop 2.0.1 and every desktop Nightly fail on Windows in Stage desktop runtime with desktop Host is missing a real Windows node-pty file: ...\node-pty\prebuilds\win32-x64\pty.node. Refs #412.

Bug Reproduction Steps

  1. Look at desktop release run 43552830250 (tag desktop-v2.0.1), or Nightly runs 43585467313 and 43706525483.
  2. The windows job fails in scripts/stage-runtime.ts at the assertWindowsNodePty check.

Root Cause

#402 removed the PTY terminal API and dropped node-pty from the @pymodel/pythinker-code optional dependencies and the lockfile. No workspace package depends on node-pty now, so pnpm deploy never installs it.

Desktop 2.0.0 then failed in afterPack because afterPack still required the win32 node-pty addons. #408 read that failure as a symlink/junction problem and added a staging check that requires the same files. The files can never exist, so every Windows desktop build now fails.

This is a fundamental fix: the requirement is stale, so it is removed.

Code Changes

  • apps/desktop/scripts/stage-runtime.ts: remove the node-pty dereference and the Windows pty.node check.
  • apps/desktop/scripts/verify-packaged-runtime.ts: afterPack checks only the Host entrypoints (dist/main.mjs, dist-web/index.html) on all platforms. The Windows node-pty restore and check are removed.
  • Root package.json: remove the fix-node-pty-perms.mjs postinstall and delete the script. It only logs "Cannot find module 'node-pty'" now.
  • Tests: remove the node-pty tests. Add a test that a Windows shell without any node-pty addon passes afterPack.
  • Changeset: desktop patch.

Behavior Changes and Affected Users

Behavior Before After Who relies on the old behavior Escape hatch
Windows desktop staging/packaging Fails: requires node-pty win32 addons Passes without node-pty Nobody: no shipped code loads node-pty since #402 None needed
Root pnpm install postinstall Tries to chmod node-pty spawn-helper, logs "skipped" Step removed Nobody: node-pty is not installed None needed

macOS and Linux packaging is unchanged: the removed checks ran only for win32. Coverage: apps/desktop/tests/stage-runtime.spec.ts and apps/desktop/tests/verify-packaged-runtime.spec.ts.

The macOS desktop job still fails until the Apple Developer agreement is renewed (notarytool HTTP 403). That is account state, not code.

Checklist

  • I have read the CONTRIBUTING document.
  • I have linked a related issue (external PRs: issue must have a maintainer's /approve).
  • I have added tests that prove my feature works.
  • The behavior-change table above is complete, and every removed behavior or flipped default is named in the changeset and either has an escape hatch or was explicitly approved by a maintainer in this PR.
  • Ran gen-changesets skill, or this PR needs no changeset.
  • Ran gen-docs skill, or this PR needs no doc update.

Summary by CodeRabbit

  • Bug Fixes
    • Fixed an issue affecting Windows desktop installer builds.
    • Improved packaged-runtime verification across desktop platforms, helping ensure required application components are present in builds.

The terminal API removal dropped node-pty from the CLI dependencies, but
desktop staging and afterPack still required its win32-x64 addons, so every
Windows desktop build (2.0.1 and each Nightly) failed in stage-runtime.
Remove the stale requirement and the dead node-pty postinstall fixup.
@pkg-pr-new

pkg-pr-new Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
pnpm dlx https://pkg.pr.new/@pymodel/pythinker-code@ab6cf5d
npx https://pkg.pr.new/@pymodel/pythinker-code@ab6cf5d

commit: ab6cf5d

@coderabbitai

coderabbitai Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

Explain Change →

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 57fcf3b and ab6cf5d.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review

No actionable comments were generated in the recent review.

Walkthrough

The Windows desktop runtime changes remove node-pty-specific staging and packaging checks, along with a postinstall permission-repair script. The packaged-runtime tests now accept packages that contain the required Host entrypoints without a Windows node-pty addon.

Changes: Windows runtime packaging

Layer / File(s) Summary
Runtime staging and packaging checks
apps/desktop/scripts/stage-runtime.ts, apps/desktop/scripts/verify-packaged-runtime.ts, apps/desktop/tests/stage-runtime.spec.ts, apps/desktop/tests/verify-packaged-runtime.spec.ts, apps/desktop/src/host-supervisor.ts, .changeset/windows-desktop-build.md
Staging no longer dereferences node-pty symlinks or checks for Windows addon files. afterPack verifies Host entrypoints without repairing or checking node-pty files. Tests now expect verification to pass when the Host entrypoints exist without a node-pty addon. The Host supervisor comment refers to surviving child processes as “shells,” and the changeset records a patch release for a Windows installer build fix.
Postinstall permission repair removal
package.json, scripts/fix-node-pty-perms.mjs
The postinstall command no longer runs the script that restores executable permissions on node-pty spawn-helper binaries. The script was removed.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Merge Risk: Minimal · previous review 57fcf

This change removes node-pty-specific Windows packaging checks and a permission-repair postinstall that the removed terminal feature made unnecessary. This should let the Windows desktop installer build again. No concrete regression was found, so the merge risk is minimal.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title uses the conventional-commit prefix "fix:", is 59 characters (under 72), and summarizes the main change: the Windows desktop package no longer requires node-pty. The title is in imperative m…
Description check Passed The description follows the repository template: it has Requirement or Bug, Bug Reproduction Steps, Root Cause (stating it is a fundamental fix), Code Changes, Behavior Changes and Affected Users (tab…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title uses the conventional-commit prefix "fix:", is 59 characters (under 72), and summarizes the main change: the Windows desktop package no longer requires node-pty. The title is in imperative mood, matching the stated requirement.

Full details: Description check

Explanation

The description follows the repository template: it has Requirement or Bug, Bug Reproduction Steps, Root Cause (stating it is a fundamental fix), Code Changes, Behavior Changes and Affected Users (table with before/after, affected users, escape hatch, and coverage), and the checklist. It names the affected test files. Minor gaps: the requirement line refers to #412 rather than a linked approved issue, and the checklist items are all ticked without a visible approval reference, but the description is substantially complete.

  • Autofix · 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

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 1b51dc4 and 57fcf3b.

Files selected for processing: 8

  • .changeset/windows-desktop-build.md
  • apps/desktop/scripts/stage-runtime.ts
  • apps/desktop/scripts/verify-packaged-runtime.ts
  • apps/desktop/src/host-supervisor.ts
  • apps/desktop/tests/stage-runtime.spec.ts
  • apps/desktop/tests/verify-packaged-runtime.spec.ts
  • package.json
  • scripts/fix-node-pty-perms.mjs
Files with no reviewable changes: 3

  • apps/desktop/scripts/stage-runtime.ts
  • apps/desktop/tests/stage-runtime.spec.ts
  • scripts/fix-node-pty-perms.mjs

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

@elkaix
elkaix enabled auto-merge (squash) November 16, 2026 11:16
@elkaix
elkaix merged commit cd4241b into main Nov 16, 2026
25 checks passed
@elkaix
elkaix deleted the fix/desktop-drop-node-pty branch November 16, 2026 11:22
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