Skip to content

fix(windows): patch packaged node-pty connect compat#977

Merged
web3dev1337 merged 1 commit intomainfrom
fix/windows-pty-connect-compat
Mar 21, 2026
Merged

fix(windows): patch packaged node-pty connect compat#977
web3dev1337 merged 1 commit intomainfrom
fix/windows-pty-connect-compat

Conversation

@web3dev1337
Copy link
Copy Markdown
Owner

Summary

  • adapt the Windows node-pty runtime compat shim beyond startProcess() so stale packaged bindings also retry connect() and related ConPTY boolean-tail methods with the legacy signatures
  • extend the packaged windowsPtyAgent.js patcher to rewrite the broken conptyNative.connect(...) call in bundled resources, not just startProcess(...)
  • cover the packaged crash path with updated unit tests and refresh the codebase docs for the broader ConPTY compatibility scope

Root cause

From the packaged Windows logs under C:\Users\AB\AppData\Roaming\com.agent.workspace\logs:

  • combined.log showed the backend successfully binding http://127.0.0.1:58490
  • error.log then showed Usage: pty.connect(id, cmdline, cwd, env, exitCallback) from node-pty/lib/windowsPtyAgent.js

That means the Tauri bootstrap path was fine. The backend became reachable briefly, then crashed immediately because the bundled JS was still calling a newer ConPTY connect() signature against an older native binding.

Testing

  • node --check server/utils/nodePtyCompat.js
  • node --check server/utils/processUtils.js
  • node --check tests/unit/nodePtyCompat.test.js
  • node --check tests/unit/sessionManager.windowsPty.test.js
  • npm run test:unit -- tests/unit/nodePtyCompat.test.js tests/unit/sessionManager.windowsPty.test.js tests/unit/commanderService.windowsShellArgs.test.js
  • npm run test:unit

@web3dev1337 web3dev1337 merged commit 5946a46 into main Mar 21, 2026
6 checks passed
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