fix: harden paired follow-up requeue handling

This commit is contained in:
ejclaw
2026-04-09 09:41:31 +09:00
parent b0f51b0366
commit 1788ddd995
5 changed files with 167 additions and 5 deletions

View File

@@ -8,7 +8,7 @@ export type ScheduledPairedFollowUpIntentKind =
type ScheduledPairedFollowUpTask = Pick<
PairedTask,
'id' | 'status' | 'round_trip_count'
'id' | 'status' | 'round_trip_count' | 'updated_at'
>;
export const SCHEDULED_PAIRED_FOLLOW_UP_TTL_MS = 10 * 60 * 1000;
@@ -26,12 +26,14 @@ export function buildPairedFollowUpKey(args: {
taskId: string;
taskStatus: PairedTaskStatus | null;
roundTripCount: number;
taskUpdatedAt: string | null | undefined;
intentKind: ScheduledPairedFollowUpIntentKind;
}): string {
return [
args.taskId,
args.taskStatus ?? 'unknown',
String(args.roundTripCount),
args.taskUpdatedAt ?? 'unknown',
args.intentKind,
].join(':');
}
@@ -52,6 +54,7 @@ export function schedulePairedFollowUpOnce(args: {
taskId: args.task.id,
taskStatus: args.task.status,
roundTripCount: args.task.round_trip_count,
taskUpdatedAt: args.task.updated_at,
intentKind: args.intentKind,
}),
].join(':');