Skip to content

Commit cabafde

Browse files
refactor(server): let EventSink place the restart notice
The event sink allocates every new turn item's position, so the notice no longer computes an ordinal it would discard. AI-assisted; verified with the tests and tools listed above.
1 parent 7c7b355 commit cabafde

1 file changed

Lines changed: 2 additions & 8 deletions

File tree

‎apps/server/src/orchestration-v2/ProviderRuntimeRecoveryService.ts‎

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -653,14 +653,8 @@ export const make = Effect.gen(function* () {
653653
providerTurnId: null,
654654
nativeItemRef: null,
655655
parentItemId: null,
656-
// EventSink places the item after the run's existing items.
657-
ordinal:
658-
Math.max(
659-
0,
660-
...projection.turnItems
661-
.filter((item) => item.runId === run.id)
662-
.map((item) => item.ordinal),
663-
) + 1,
656+
// EventSink allocates the real position, after the run's existing items.
657+
ordinal: 0,
664658
status: "completed",
665659
title: trigger === "startup" ? "Server restarted" : "Server shut down",
666660
startedAt: now,

0 commit comments

Comments
 (0)