Fixed how payload-as-prompt is handled and progress comment updates (#212)
This commit is contained in:
committed by
pullfrog[bot]
parent
18ba8e5fd0
commit
bfe72ac2cf
+10
-6
@@ -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";
|
||||
|
||||
Reference in New Issue
Block a user