fix: recover interrupted paired turn attempts

This commit is contained in:
ejclaw
2026-05-27 05:57:29 +09:00
parent c4e0e7459f
commit 0177437a8a
5 changed files with 283 additions and 1 deletions

View File

@@ -45,6 +45,8 @@ import {
clearPairedTurnAttemptsInDatabase,
getOwnerCodexBadRequestFailureSummaryForTaskFromDatabase,
getPairedTurnAttemptsForTurnFromDatabase,
recoverInterruptedPairedTurnAttemptsForServiceInDatabase,
type InterruptedPairedTurnAttemptRecoveryCandidate,
type OwnerCodexBadRequestFailureSummary,
type PairedTurnAttemptRecord,
} from './paired-turn-attempts.js';
@@ -239,6 +241,17 @@ export function getPairedTurnAttempts(
return getPairedTurnAttemptsForTurnFromDatabase(requireDatabase(), turnId);
}
export function recoverInterruptedPairedTurnAttemptsForService(args: {
serviceId: string;
now?: string;
error?: string;
}): InterruptedPairedTurnAttemptRecoveryCandidate[] {
return recoverInterruptedPairedTurnAttemptsForServiceInDatabase(
requireDatabase(),
args,
);
}
export function getOwnerCodexBadRequestFailureSummaryForTask(args: {
taskId: string;
threshold: number;