Skip to content
Source
Sign inSign up
pingdotgg/t3code

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

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

Showing 9 changed files with 37 additions and 11 deletions (loading 8).

x
0 of 9 viewed, 9 left
37 additions and 11 deletionsapps/server/src/orchestration-v2/Orchestrator.tsModified
View file
@@ -1317,7 +1317,7 @@
"contextTransfers",
- turnItemTypes: ["user_message", "error"],
+ turnItemTypes: ["user_message", "error", "notification"],
messageRoles: ["user"],
omitSettledLeafNodes: true,
// Commands here read only undelivered or active tasks; a dispatcher thread keeps
@@ -3799,7 +3799,7 @@
const projection = yield* loadProjectionForCommand(
command,
["runs", "runtimeRequests", "turnItems"],
- { turnItemTypes: ["error"] },
+ { turnItemTypes: ["user_message", "error", "notification"] },
const run = usageLimitBlockedRun(projection.runs, projection.turnItems, null);
const failure = latestRootProviderFailure(run, projection.turnItems);
@@ -5854,7 +5854,10 @@
source === undefined ||
(source.status !== "interrupted" &&
!(source.status === "failed" && limited?.class === "usage_limit")) ||
- latestExecutedRun(projection.runs)?.id !== source.id ||
+ (
+ usageLimitBlockedRun(projection.runs, projection.turnItems, null) ??
+ latestExecutedRun(projection.runs)
+ )?.id !== source.id ||
projection.thread.archivedAt !== null ||