Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): keep old failures from waking snoozed V2 threads #9903

Mergedsaphid(GitHub profile, opens in a new tab)merged 2 commits intot3code/codex-turn-mapping fromrefs/pull/9903/headmerged by juliusmarminge View on GitHub

Showing 2 changed files with 27 additions and 2 deletions.

x
0 of 2 viewed, 2 left
24 additions and 1 deletionapps/server/src/orchestration-v2/ThreadSettlementService.test.tsModified
View file
@@ -130,13 +130,36 @@
snoozedAt: at(-60 * 60 * 1_000),
});
expect(isAutoSettlementCandidate(snoozed, NOW_MS)).toBe(false);
- expect(isAutoSettlementCandidate(shell({ ...snoozed, status: "failed" }), NOW_MS)).toBe(true);
+ expect(
+ isAutoSettlementCandidate(
+ shell({ ...snoozed, status: "failed", latestRunCompletedAt: at(-30 * 60 * 1_000) }),
+ NOW_MS,
+ ),
+ ).toBe(true);
expect(
isAutoSettlementCandidate(
shell({ ...snoozed, latestRunCompletedAt: at(-30 * 60 * 1_000) }),
NOW_MS,
).toBe(true);
+ expect(
+ isAutoSettlementCandidate(
+ shell({ ...snoozed, status: "failed", latestRunCompletedAt: at(-2 * 60 * 60 * 1_000) }),
+ NOW_MS,
+ ),
+ ).toBe(false);
+ expect(
+ isAutoSettlementCandidate(
+ shell({ ...snoozed, status: "failed", latestRunCompletedAt: snoozed.snoozedAt }),
+ NOW_MS,
+ ),
+ ).toBe(false);
+ expect(