Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): usage-limit recovery survives notification wakes that did no work #38498

Closedyspreen(GitHub profile, opens in a new tab)wants to merge 8 commits intomain fromrefs/pull/38498/headopened View on GitHub

Showing 12 changed files with 57 additions and 12 deletions (loading 11).

x
0 of 12 viewed, 12 left
57 additions and 12 deletionsapps/server/src/orchestration-v2/Orchestrator.tsModified
View file
@@ -9,9 +9,12 @@
import {
latestExecutedRun,
latestRootProviderFailure,
+ latestRunIgnoringLimitedWakes,
+ notificationStartedWakeCandidates,
orchestrationV2WorktreePending,
runRanAfter,
usageLimitBlockedRun,
+ usageLimitWakeCandidates,
} from "@t3tools/shared/orchestrationV2ThreadError";
import { threadIssueKeysEqual } from "@t3tools/contracts";
import { canonicalizeGitCafePullRequestUrl } from "@t3tools/source-control-definitions/registry";
@@ -1071,7 +1074,9 @@
latestSession?.lastError ?? null,
if (limited === null) return false;
- if (latestExecutedRun(projection.runs)?.id === limited.id) return true;
+ if (latestRunIgnoringLimitedWakes(projection.runs, projection.turnItems)?.id === limited.id) {
+ return true;
+ }
if (now === undefined) return false;
const resetAt = latestRootProviderFailure(limited, projection.turnItems)?.resetAt;
return resetAt != null && Date.parse(resetAt) > DateTime.toEpochMillis(now);
@@ -1709,6 +1714,36 @@
return false;