Skip to content

Fix Windows bundled ConPTY packaging - #6968

Merged
brennanb2025 merged 1 commit into
mainfrom
brennanb2025/fix-windows-daemon-spawn
Jul 1, 2026
Merged

brennanb2025 merged 1 commit into
mainfrom
brennanb2025/fix-windows-daemon-spawn

Conversation

@brennanb2025

@brennanb2025 brennanb2025 commented Jul 1, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • copy node-pty's bundled ConPTY runtime beside the rebuilt Windows addon during packaging
  • pass the electron-builder target arch into runtime pruning so x64/arm64 select the right payload
  • add a Windows release guard before SignPath/upload so missing ConPTY files block the release

Regression

Windows daemon terminals now intentionally set useConptyDll: true for modern ConPTY wrap-marker behavior. Existing Windows installers lacked resources/node_modules/node-pty/build/Release/conpty/conpty.dll, so node-pty failed with Cannot find conpty.dll when spawning shells.

I verified the v1.4.112 installer payload was missing build/Release/conpty/conpty.dll, then ran the patched packager against that extracted payload and confirmed it created both conpty.dll and OpenConsole.exe.

Tests

  • pnpm exec vitest run config/scripts/electron-builder-config.test.mjs config/scripts/package-electron-runtime-contract.test.mjs
  • pnpm exec vitest run src/main/daemon/pty-subprocess.test.ts
  • pnpm exec oxlint config/packaged-runtime-node-modules.cjs config/electron-builder.config.cjs config/scripts/electron-builder-config.test.mjs config/scripts/package-electron-runtime-contract.test.mjs
  • git diff --check

Made with Orca 🐋


Open in Stage

@ghost

ghost commented Jul 1, 2026

Copy link
Copy Markdown

Ready to review this PR? Stage has broken it down into 4 individual chapters for you:

Title
1 Implement Windows ConPTY runtime packaging logic
2 Wire architecture context into runtime pruning
3 Add unit tests for ConPTY packaging
4 Verify ConPTY runtime in release workflow
Open in Stage

Chapters generated by Stage for commit 653c0cb on Jul 1, 2026 1:01am UTC.

@brennanb2025
brennanb2025 merged commit 22db5b7 into main Jul 1, 2026
7 checks passed
@brennanb2025
brennanb2025 deleted the brennanb2025/fix-windows-daemon-spawn branch July 1, 2026 01:05
@coderabbitai

coderabbitai Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

This change adds Windows ConPTY runtime support for packaged node-pty builds. The electron-builder pruning script gains helpers to locate and copy conpty.dll and OpenConsole.exe into the packaged build/Release/conpty directory, with an electronArch parameter threaded through prunePackagedNodePty and prunePackagedRuntimeNodeModules, and the afterPack config now passes the target architecture. The release-cut GitHub Actions workflow adds a PowerShell preflight step on Windows builds to verify these runtime files exist before signing. Corresponding unit and contract tests were added/updated to cover the copy behavior and workflow step ordering.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning It includes summary and tests, but omits required Screenshots, AI Review Report, Security Audit, and Notes sections. Add the missing template sections, or explicitly mark screenshots as none, document the AI review and security audit, and include any platform-specific notes.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly matches the main change: fixing Windows ConPTY packaging.
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.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

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

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
config/scripts/electron-builder-config.test.mjs (1)

176-199: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Add arm64 coverage for the architecture-specific payload selection.

This test only exercises the win10-x64 path. Add a second case for win10-arm64 so the PR’s x64/arm64 selection contract is covered by tests.


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 97a37c37-21ef-4a52-8430-0908e792bf0e

📥 Commits

Reviewing files that changed from the base of the PR and between 764e2fe and 653c0cb.

📒 Files selected for processing (5)
  • .github/workflows/release-cut.yml
  • config/electron-builder.config.cjs
  • config/packaged-runtime-node-modules.cjs
  • config/scripts/electron-builder-config.test.mjs
  • config/scripts/package-electron-runtime-contract.test.mjs

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