Add post hooks for cleanup (#193)

* Add post hooks for cleanup

* Switch to signal-based cleanup

* Better exit handling
This commit is contained in:
Colin McDonnell
2026-01-28 01:59:15 +00:00
committed by pullfrog[bot]
parent 90945a9481
commit 102417f442
9 changed files with 20395 additions and 20370 deletions
+4 -8
View File
@@ -30,11 +30,9 @@ export interface ToolState {
promise: Promise<PrepResult[]> | undefined;
results: PrepResult[] | undefined;
};
progressComment: {
id: number | null;
wasUpdated: boolean;
};
progressCommentId: number | null;
lastProgressBody?: string;
wasUpdated?: boolean;
}
import type { ResolveRunResult } from "../utils/workflow.ts";
@@ -46,12 +44,10 @@ interface InitToolStateParams {
export function initToolState(ctx: InitToolStateParams): ToolState {
const progressCommentIdStr = ctx.runInfo.workflowRunInfo.progressCommentId;
const progressCommentId = progressCommentIdStr ? parseInt(progressCommentIdStr, 10) : null;
const resolvedId = Number.isNaN(progressCommentId) ? null : progressCommentId;
return {
progressComment: {
id: Number.isNaN(progressCommentId) ? null : progressCommentId,
wasUpdated: false,
},
progressCommentId: resolvedId,
backgroundProcesses: new Map(),
};
}