mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-11-04 11:01:16 +01:00
Preserve exact user-authorized continuation receipts across bounded retries and retain the task claim through owned retry admission. Stop, reassignment, superseding input, and active cleanup continue to block unsafe continuation. Validation: exact-head Greptile 5/5, passing CI, no unresolved review threads, and a clean merge. Detailed verification and limitations are recorded in the pull request. Co-Authored-By: Paperclip <noreply@paperclip.ing>
15 lines
780 B
TypeScript
15 lines
780 B
TypeScript
import type { heartbeatRuns, issues } from "@paperclipai/db";
|
|
|
|
/**
|
|
* This claim must be settled by queue-first recovery, not generic terminal-lock
|
|
* cleanup. It is pending intent only; admission still validates its authority.
|
|
*/
|
|
export function isExplicitContinuationRetryClaim(
|
|
issue: Pick<typeof issues.$inferSelect, "id" | "companyId" | "executionRunId">,
|
|
run: Pick<typeof heartbeatRuns.$inferSelect, "id" | "companyId" | "runtimeMode" | "status" | "contextSnapshot"> | null | undefined,
|
|
) {
|
|
return Boolean(run && issue.executionRunId === run.id && run.companyId === issue.companyId &&
|
|
run.runtimeMode === "legacy" && ["failed", "timed_out"].includes(run.status) &&
|
|
run.contextSnapshot?.issueId === issue.id && run.contextSnapshot.explicitUserContinuation);
|
|
}
|