Files
PaperClipAI/server/src/services/execution-recovery-attempt.test.ts
T
DottaandPaperclip 35fdc0c66b fix: make task recovery durable and preserve current requests (#13075)
Make task recovery durable and preserve the latest user request across native and legacy continuations. Keep routine recovery quiet and prevent replay when action outcomes are uncertain.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-09-09 09:14:25 -05:00

18 lines
1.1 KiB
TypeScript

import { describe, expect, it } from "vitest";
import { executionFailureRetryCount } from "./execution-recovery-attempt.js";
describe("failure attempts across resource waits", () => {
it("preserves prior failures through repeated workspace waits", () => {
expect(executionFailureRetryCount({ scheduledRetryReason: "workspace_busy", scheduledRetryAttempt: 12,
contextSnapshot: { failureRetriesBeforeWorkspaceWait: 1 } })).toBe(1);
});
it("does not trust a caller-supplied count outside a server-created workspace retry", () => {
expect(executionFailureRetryCount({ scheduledRetryReason: "transient_failure", scheduledRetryAttempt: 2,
contextSnapshot: { failureRetriesBeforeWorkspaceWait: 0 } })).toBe(2);
});
it("keeps ambiguous historical counts and starts a new incident after productive continuation", () => {
expect(executionFailureRetryCount({ scheduledRetryReason: "workspace_busy", scheduledRetryAttempt: 4 })).toBe(4);
expect(executionFailureRetryCount({ scheduledRetryReason: "max_turns_continuation", scheduledRetryAttempt: 4 })).toBe(0);
});
});