fix(providers): retain worker cleanup owners through shutdown

Validation: integrated changes passed formatting, typecheck, lint, resolved module-boundary verification and git diff --check. Tests and real-provider workflows were not run.
This commit is contained in:
morluto
2026-10-11 00:03:21 +08:00
parent a01148553e
commit d1235fadc9
24 changed files with 688 additions and 120 deletions
+2 -1
View File
@@ -22,6 +22,7 @@ export class OwnedCommandFailure extends Error {
readonly cleanupFailure: string | null = null,
options?: ErrorOptions,
readonly resources: readonly string[] = [],
readonly cleanupOwner?: ProviderProcessSupervisor,
) {
super(message, options);
}
@@ -183,7 +184,6 @@ const collectOwnedCommand = async (
}
const stopped = await supervisor.stop();
const snapshot = supervisor.snapshot();
supervisor.dispose();
if (stopped.status === "incomplete")
throw new OwnedCommandFailure(
failure?.reason ?? "process",
@@ -197,6 +197,7 @@ const collectOwnedCommand = async (
`pid:${launched.ownership.leaderPid}`,
`process-group:${launched.ownership.processGroupId}`,
],
supervisor,
);
if (failure !== undefined)
throw new OwnedCommandFailure(