fix(acp): drain runtime handles on gateway shutdown (#121359)

* fix(acp): drain runtime handles on gateway shutdown

* refactor(acp): isolate manager shutdown lifecycle

* style(acp): brace lifecycle guard

* fix(acp): cancel active turns before shutdown drain

* fix(acpx): reap process tree before wrapper close

* fix(test): diagnose surviving Vitest process groups

* fix(test): type process completion signals portably

* fix(test): reap orphaned live Docker workers

* fix(test): preserve child signal typing

* fix(gateway): retain ACPX through manager drain

* test(gateway): type deferred ACP disposal exactly
This commit is contained in:
Peter Steinberger
2026-08-09 23:55:19 -07:00
committed by GitHub
parent 6b365fa5d3
commit 8bb1fe4d7e
13 changed files with 290 additions and 14 deletions
+5
View File
@@ -219,6 +219,7 @@ describe("scripts/lib/live-docker-auth.sh", () => {
"42s",
"docker",
"run",
"--init",
"--memory",
"8g",
"--cpus",
@@ -270,6 +271,7 @@ describe("scripts/lib/live-docker-auth.sh", () => {
"42s",
"docker",
"run",
"--init",
"--memory",
"8g",
"--cpus",
@@ -293,6 +295,7 @@ describe("scripts/lib/live-docker-auth.sh", () => {
"42s",
"docker",
"run",
"--init",
"--memory",
"8g",
"--cpus",
@@ -322,6 +325,7 @@ describe("scripts/lib/live-docker-auth.sh", () => {
"42s",
"docker",
"run",
"--init",
"--memory",
"8g",
"--cpus",
@@ -373,6 +377,7 @@ describe("scripts/lib/live-docker-auth.sh", () => {
"42s",
"docker",
"run",
"--init",
]);
});
+10
View File
@@ -5,6 +5,7 @@ import {
createVitestProcessCompletion,
forwardSignalToVitestProcessGroup,
installVitestProcessGroupCleanup,
parseVitestProcessGroupMembers,
resolveVitestProcessGroupSignalTarget,
shouldUseDetachedVitestProcessGroup,
} from "../../scripts/vitest-process-group.mts";
@@ -42,6 +43,15 @@ describe("vitest process group helpers", () => {
);
});
it("formats bounded process-group diagnostics without command arguments", () => {
expect(
parseVitestProcessGroupMembers(
[" 116 1 116 Z node", " 117 1 116 Sl claude", " 118 1 999 S unrelated"].join("\n"),
116,
),
).toBe("pid=116 ppid=1 state=Z comm=node; pid=117 ppid=1 state=Sl comm=claude");
});
it("forwards signals to the computed target and ignores cleanup races", () => {
const kill = vi.fn();
expect(