mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-11-10 12:37:55 +01:00
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>
18 lines
1.1 KiB
TypeScript
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);
|
|
});
|
|
});
|