orchestrating 0.1.9 → 0.1.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/orch +8 -2
- package/package.json +1 -1
package/bin/orch
CHANGED
|
@@ -305,6 +305,7 @@ if (!adapter) {
|
|
|
305
305
|
}
|
|
306
306
|
|
|
307
307
|
let child;
|
|
308
|
+
let childRunning = false;
|
|
308
309
|
let handleServerMessage; // set per-mode
|
|
309
310
|
let exitRequested = false;
|
|
310
311
|
|
|
@@ -330,7 +331,6 @@ if (adapter) {
|
|
|
330
331
|
|
|
331
332
|
// Confirmation-type tools — these need "yes" response, not permission grants
|
|
332
333
|
const CONFIRMATION_TOOLS = new Set(["ExitPlanMode", "EnterPlanMode"]);
|
|
333
|
-
let childRunning = false;
|
|
334
334
|
|
|
335
335
|
// Build clean env for child processes (no nesting detection, no leaked keys)
|
|
336
336
|
const childEnv = (() => {
|
|
@@ -888,7 +888,13 @@ function cleanup() {
|
|
|
888
888
|
process.on("SIGINT", () => {
|
|
889
889
|
if (adapter) {
|
|
890
890
|
exitRequested = true;
|
|
891
|
-
|
|
891
|
+
if (childRunning) {
|
|
892
|
+
child.kill("SIGINT");
|
|
893
|
+
} else {
|
|
894
|
+
// Child already exited (idle/waiting for follow-up) — exit now
|
|
895
|
+
cleanup();
|
|
896
|
+
process.exit(0);
|
|
897
|
+
}
|
|
892
898
|
} else {
|
|
893
899
|
child.stdin.write("\x03");
|
|
894
900
|
}
|