mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-11-01 15:35:12 +01:00
Preserve agent output and earlier execution errors when workspace restore fails. Report the restore phase and confirmed saved-plan links. Require verified repair before retrying unsafe archives, while preserving approval states and the retry budget. Verified with full CI, 506 focused regression tests, and Greptile 5/5 with all review threads resolved. Co-Authored-By: Paperclip <noreply@paperclip.ing>
19 lines
749 B
TypeScript
19 lines
749 B
TypeScript
import { safeWorkspaceRestorePath } from "@paperclipai/shared";
|
|
|
|
export function workspaceRestoreMarkerDetail(input: {
|
|
result: Record<string, unknown> | null | undefined;
|
|
savedPlan: boolean;
|
|
hasResponse: boolean;
|
|
}): string {
|
|
const parts = [input.savedPlan
|
|
? "Workspace restore failed after the plan was saved. The saved plan is available."
|
|
: "Workspace restore failed."];
|
|
parts.push("Workspace files need recovery.");
|
|
if (!input.hasResponse && input.result?.finalResponseRecorded === false) {
|
|
parts.push("No final response was recorded.");
|
|
}
|
|
const relativePath = safeWorkspaceRestorePath(input.result?.workspaceRestorePath);
|
|
if (relativePath) parts.push(`Affected path: ${relativePath}.`);
|
|
return parts.join(" ");
|
|
}
|