Reverse engineer anything with agents, from app behavior down to native binaries.
TypeScript agent-skillsai-agentsbinary-analysisclaude-codeclicodexcordisdecompilerdeveloper-toolsdshdsh-pluginghidrahopperllmmcpmodel-context-protocolreareverse-engineeringstatic-analysistouhou
test(process): retain cancellation checks under unverified host cleanup
morluto9a5b07789931
diff --git a/tests/boundary/process/processCaptureLifecycle.test.ts b/tests/boundary/process/processCaptureLifecycle.test.tsindex 3ece19b77..dc4219d14 100644--- a/tests/boundary/process/processCaptureLifecycle.test.ts+++ b/tests/boundary/process/processCaptureLifecycle.test.ts@@ -34,17 +34,9 @@ type PartialCapture = Extract<NonNullable<ProcessCaptureError["partialObservation"]>,{ readonly capture: unknown }>["capture"];-const captureObservations = (- result: CaptureRun,-): {- readonly capture: ProcessCapture | PartialCapture;- readonly cleanupIncomplete: boolean;-} => {- if (result.ok) return { capture: result.value, cleanupIncomplete: false };- if (!(result.error instanceof ProcessCaptureError)) throw result.error;- const report = result.error.cleanupReport;- const partial = result.error.partialObservation;- expect(result.error.reason).toBe("cleanup_incomplete");+const expectUnverifiedHostCleanup = (error: ProcessCaptureError): void => {+ const report = error.cleanupReport;+ expect(error.reason, error.message).toBe("cleanup_incomplete");expect(report?.owned_process_group.state).toBe("unverified");const [summary, diagnostics] = (report?.owned_process_group.reason ?? ""@@ -66,6 +58,18 @@ const captureObservations = ();expect(report?.terminal_renderer.state).toBe("cleaned");expect(report?.temporary_root.state).toBe("cleaned");+};++const captureObservations = (+ result: CaptureRun,+): {+ readonly capture: ProcessCapture | PartialCapture;+ readonly cleanupIncomplete: boolean;+} => {+ if (result.ok) return { capture: result.value, cleanupIncomplete: false };+ if (!(result.error instanceof ProcessCaptureError)) throw result.error;+ expectUnverifiedHostCleanup(result.error);+ const partial = result.error.partialObservation;if (partial === undefined || !("capture" in partial))throw new Error("cleanup-incomplete capture omitted completed observations",@@ -521,7 +525,17 @@ itWithCaptureCapability(const result = await resultPromise;if (result.ok) throw new Error("expected final snapshot cancellation");expect(initialSnapshotCompleted).toBe(true);- expect(result.error).toMatchObject({+ if (!(result.error instanceof ProcessCaptureError)) throw result.error;+ if (result.error.cleanupIncomplete) {+ expectUnverifiedHostCleanup(result.error);+ expect(result.error.executionFailure).toBe(+ "process capture was cancelled",+ );+ }+ const cancellation = result.error.cleanupIncomplete+ ? result.error.cause+ : result.error;+ expect(cancellation, result.error.message).toMatchObject({reason: "cancelled",userCategory: "cancelled",});