feat(FN-4626): complete Step 5 — align worktrunk failure payload shape

Fusion-Task-Id: FN-4626
Fusion-Task-Lineage: 04b06bf6-b08c-4ff1-b69a-ab93f6e508b3
This commit is contained in:
Fusion (runfusion.ai)
2026-05-15 22:03:39 -07:00
committed by gsxdsm
parent 99860e8419
commit 80382ed911
2 changed files with 10 additions and 1 deletions

View File

@@ -119,7 +119,13 @@ export async function acquireTaskWorktree(opts: AcquireTaskWorktreeOptions): Pro
const stderr = error instanceof WorktrunkOperationError ? error.stderr : undefined;
const exitCode = error instanceof WorktrunkOperationError ? error.exitCode : null;
const disposition = await handleWorktrunkOperationFailure({
failure: { op, cause: error, stderr, exitCode },
failure: {
op,
cause: error,
stderr,
exitCode,
worktreePath,
},
task,
settings: settings.worktrunk ?? {},
store,

View File

@@ -14,6 +14,7 @@ export interface WorktrunkOperationFailure {
exitCode?: number | null;
durationMs?: number;
binaryPath?: string;
worktreePath?: string;
}
export type WorktreeOperationResult = { path: string; branch: string } | { skipped: boolean } | void;
@@ -73,6 +74,7 @@ async function pauseTaskWithFailure(
exitCode: failure.exitCode ?? null,
stderrPreview: toStderrPreview(failure.stderr),
binaryPath: failure.binaryPath,
worktreePath: failure.worktreePath,
durationMs: failure.durationMs,
},
});
@@ -118,6 +120,7 @@ export async function handleWorktrunkOperationFailure(params: HandleFailureParam
exitCode: failure.exitCode ?? null,
stderrPreview: toStderrPreview(failure.stderr),
binaryPath: failure.binaryPath,
worktreePath: failure.worktreePath,
durationMs: failure.durationMs,
alerted,
},