@devries-cameron20 / t3code Mirror · read-only / commits / b21f3b7191
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 23, 21:45 UTC

fix(server): prevent Windows PTY helper crashes in watch mode (#14179)

Utkarsh Patil committed Sep 29, 2026 at 04:31 UTC b21f3b71913370a1a650a61fd9082f992d40e657
3 files changed +39 -2
patches/node-pty@1.2.0-beta.15.patch new
+35
@@ -0,0 +1,35 @@
1 +diff --git a/lib/windowsConoutConnection.js b/lib/windowsConoutConnection.js
2 +--- a/lib/windowsConoutConnection.js
3 ++++ b/lib/windowsConoutConnection.js
4 +@@ -63,7 +63,11 @@
5 + conoutPipeName: _conoutPipeName
6 + };
7 + var scriptPath = __dirname.replace('node_modules.asar', 'node_modules.asar.unpacked');
8 +- this._worker = new worker_threads_1.Worker((0, path_1.join)(scriptPath, 'worker/conoutSocketWorker.js'), { workerData: workerData });
9 ++ // Node's watch mode reports dependencies through worker messages.
10 ++ // Keep the host's watch environment out of this protocol worker.
11 ++ var workerEnv = Object.assign({}, process.env);
12 ++ delete workerEnv.WATCH_REPORT_DEPENDENCIES;
13 ++ this._worker = new worker_threads_1.Worker((0, path_1.join)(scriptPath, 'worker/conoutSocketWorker.js'), { workerData: workerData, env: workerEnv, execArgv: [] });
14 + this._worker.on('message', function (message) {
15 + switch (message) {
16 + case 1 /* ConoutWorkerMessage.READY */:
17 +diff --git a/lib/windowsPtyAgent.js b/lib/windowsPtyAgent.js
18 +--- a/lib/windowsPtyAgent.js
19 ++++ b/lib/windowsPtyAgent.js
20 +@@ -218,8 +218,14 @@
21 + return Promise.resolve([]);
22 + }
23 + return new Promise(function (resolve) {
24 +- var agent = (0, child_process_1.fork)(path.join(__dirname, 'conpty_console_list_agent'), [_this._innerPid.toString()]);
25 ++ // Node's watch mode sends its own messages over the helper's IPC channel.
26 ++ var agentEnv = Object.assign({}, process.env);
27 ++ delete agentEnv.WATCH_REPORT_DEPENDENCIES;
28 ++ var agent = (0, child_process_1.fork)(path.join(__dirname, 'conpty_console_list_agent'), [_this._innerPid.toString()], { env: agentEnv, execArgv: [] });
29 + agent.on('message', function (message) {
30 ++ if (!Array.isArray(message.consoleProcessList)) {
31 ++ return;
32 ++ }
33 + clearTimeout(timeout);
34 + resolve(message.consoleProcessList);
35 + });
pnpm-lock.yaml
+3 -2
@@ -107,6 +107,7 @@ patchedDependencies:
107 expo-notifications@57.0.15: f89252c2c08dc7b3acb8415f319ebbe15fff8c9f88a64ebe1830cd5ac5c9ac40
108 expo-sharing@57.0.17: 8d2e3b10eb3f52036a9a086800180ec6cebf3b75bccc5b1775117a7244d4ac45
109 expo-widgets@57.0.15: 319a9ded5db49c5b5215c511a138b33f44c7ea2972eb418192e8d5342fe75ce6
110 + node-pty@1.2.0-beta.15: f2fe901c61cde17986240002d05c172d5d0272d83ffaab8d0ebeb922763be414
111 react-native-gesture-handler@2.32.0: 0579f8e4dad02bf3183d95b02620358412983c36f9bda7425dc8bcb9643b5ce2
112 react-native-keyboard-controller@1.21.13: 6e4339347bc5bb3c9ea67d85ff5c814058b211c5750f247aba59d07869a2e787
113 react-native-nitro-markdown@0.5.8: 642b47830730acff3761fe29cf54271d18b493c0070c750097850b7ea032e00c
@@ -532,7 +533,7 @@ importers:
533 version: 4.0.0-rc.115(patch_hash=0dfc4bb8ebd80fb3e06b91ef61346f5259517ab0f2437644fe95ae531084b1f5)
534 node-pty:
535 specifier: ^1.2.0-beta.15
535 - version: 1.2.0-beta.15
536 + version: 1.2.0-beta.15(patch_hash=f2fe901c61cde17986240002d05c172d5d0272d83ffaab8d0ebeb922763be414)
537 stream-chain:
538 specifier: ^4.2.5
539 version: 4.2.5
@@ -20110,7 +20111,7 @@ snapshots:
20111
20112 node-mock-http@1.0.5: {}
20113
20113 - node-pty@1.2.0-beta.15:
20114 + node-pty@1.2.0-beta.15(patch_hash=f2fe901c61cde17986240002d05c172d5d0272d83ffaab8d0ebeb922763be414):
20115 dependencies:
20116 node-addon-api: 7.1.1
20117
pnpm-workspace.yaml
+1
@@ -196,6 +196,7 @@ patchedDependencies:
196 expo-notifications@57.0.15: patches/expo-notifications@57.0.15.patch
197 expo-sharing@57.0.17: patches/expo-sharing@57.0.17.patch
198 expo-widgets@57.0.15: patches/expo-widgets@57.0.15.patch
199 + node-pty@1.2.0-beta.15: patches/node-pty@1.2.0-beta.15.patch
200 react-native-gesture-handler@2.32.0: patches/react-native-gesture-handler@2.32.0.patch
201 react-native-keyboard-controller@1.21.13: patches/react-native-keyboard-controller@1.21.13.patch
202 react-native-nitro-modules@0.35.9: patches/react-native-nitro-modules@0.35.9.patch