Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): keep interrupted threads resumable after restarts #10421

Mergedmaria-rcksmerged 2 commits intomain fromrefs/pull/10421/headmerged by maria-rcks View on GitHub

Showing 5 changed files with 123 additions and 0 deletions (loading 4).

x
0 of 5 viewed, 5 left
123 additions and 0 deletionsapps/server/integration/orphanedProviderSessionStartup.integration.test.tsModified
View file
@@ -7,10 +7,13 @@
ProjectId,
ProviderDriverKind,
ProviderInstanceId,
+ type ProviderSendTurnInput,
ThreadId,
+ TurnId,
} from "@t3tools/contracts";
import { assert, it } from "@effect/vitest";
import * as DateTime from "effect/DateTime";
+import * as Deferred from "effect/Deferred";
import * as Effect from "effect/Effect";
import * as Exit from "effect/Exit";
import * as Layer from "effect/Layer";
@@ -361,3 +364,123 @@
+​
+it.effect.each(["opt-in desktop restart", "marked remote update"] as const)(
+ "continues a newer persisted turn after %s",
+ (restart) =>
+ Effect.gen(function* () {
+ const config = yield* ServerConfig.ServerConfig;
+ const createdAt = DateTime.formatIso(yield* DateTime.now);
+ const activeTurnId = TurnId.make("turn-started-after-original-send");
+ const originalTurnId = TurnId.make("turn-from-original-send");
+ const sent = yield* Deferred.make<ProviderSendTurnInput>();
+​