Fixed how payload-as-prompt is handled and progress comment updates (#212)

This commit is contained in:
Mateusz Burzyński
2026-02-01 22:13:39 +00:00
committed by pullfrog[bot]
parent 18ba8e5fd0
commit bfe72ac2cf
8 changed files with 126 additions and 166 deletions
+10 -6
View File
@@ -35,17 +35,20 @@ export interface ToolState {
output?: string;
}
import type { ResolveRunResult } from "../utils/workflow.ts";
interface InitToolStateParams {
runInfo: ResolveRunResult;
progressCommentId: string | undefined;
}
export function initToolState(ctx: InitToolStateParams): ToolState {
const progressCommentIdStr = ctx.runInfo.workflowRunInfo.progressCommentId;
const progressCommentId = progressCommentIdStr ? parseInt(progressCommentIdStr, 10) : null;
export function initToolState(params: InitToolStateParams): ToolState {
const progressCommentId = params.progressCommentId
? parseInt(params.progressCommentId, 10)
: null;
const resolvedId = Number.isNaN(progressCommentId) ? null : progressCommentId;
if (progressCommentId) {
log.info(`» using pre-created progress comment: ${progressCommentId}`);
}
return {
progressCommentId: resolvedId,
backgroundProcesses: new Map(),
@@ -65,6 +68,7 @@ export interface ToolContext {
jobId: string | undefined;
}
import { log } from "../utils/cli.ts";
import type { RunContextData } from "../utils/runContextData.ts";
import { BashTool, KillBackgroundTool } from "./bash.ts";
import { CheckoutPrTool } from "./checkout.ts";