fix(process): await cleanup on CLI and MCP cancellation

Propagate CLI interrupts to capture and interrupt post-exit settlement
without cancelling owned-resource cleanup or discarding prior observations.

Assisted-by: Kogasa (gensokyo-skills:kogasa-surprise-testing)
This commit is contained in:
Ysopwnable authored and GitHub committed 2026-10-09 11:26:41 +00:00
1 parent b189c3ceb1
commit f6fe575094
8 files changed
+327 -18

No files matched your search

+8 -5
View File
@@ -8,6 +8,7 @@ import {
import { logCliCommand } from "../cliLogging.js";
import type { Logger } from "../logger.js";
import { CLI_COMMANDS } from "../cliCommandNames.js";
import { withCommandCancellation } from "./commandCancellation.js";
/** Register direct process capture and comparison commands. */
export const registerProcessCommands = (
@@ -19,11 +20,13 @@ export const registerProcessCommands = (
description: "Capture one caller-selected process scenario",
args: z.object({ scenario: z.string().describe("Scenario JSON path") }),
run: ({ args }) =>
logCliCommand(
logger,
"capture-process",
() => captureProcessScenarioFile(args.scenario, environment),
isProcessCliFailure,
withCommandCancellation((signal) =>
logCliCommand(
logger,
"capture-process",
() => captureProcessScenarioFile(args.scenario, environment, signal),
isProcessCliFailure,
),
),
});
cli.command(CLI_COMMANDS.compareProcessCaptures, {