Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): keep failed threads out of automatic settlement #27058

Opendoublesharp(GitHub profile, opens in a new tab)wants to merge 6 commits intomain fromrefs/pull/27058/headopened View on GitHub

Showing 5 changed files with 102 additions and 41 deletions (loading 3).

x
0 of 5 viewed, 5 left
54 additions and 7 deletionsapps/server/src/orchestration-v2/ProjectionSettlement.test.tsModified
View file
@@ -77,6 +77,8 @@
threadId: ThreadId,
status: OrchestrationV2Run["status"] = "completed",
ordinal = 1,
+ at = old,
+ queueHeld = false,
) {
const store = yield* ProjectionStore.ProjectionStoreV2;
const runId = RunId.make(`run:${threadId}:${ordinal}`);
@@ -84,7 +86,7 @@
id: EventId.make(`event:${runId}`),
type: "run.created",
threadId,
- occurredAt: old,
+ occurredAt: at,
payload: {
id: runId,
threadId,
@@ -96,9 +98,10 @@
rootNodeId: null,
activeAttemptId: null,
status,
- requestedAt: old,
- startedAt: status === "queued" ? null : old,
- completedAt: ["completed", "rolled_back", "failed"].includes(status) ? old : null,
+ queueHeld,
+ requestedAt: at,
+ startedAt: status === "queued" ? null : at,