Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(client-runtime): cache running threads when their view closes #25213

Mergedmaria-rcksmerged 2 commits intomain fromrefs/pull/25213/headmerged by juliusmarminge View on GitHub

Showing 2 changed files with 47 additions and 1 deletion.

x
0 of 2 viewed, 2 left
46 additions and 0 deletionspackages/client-runtime/src/state/threads-sync.test.tsModified
View file
@@ -6,6 +6,7 @@
NodeId,
ORCHESTRATION_V2_WS_METHODS,
RuntimeRequestId,
+ RunId,
ThreadId,
TurnItemId,
type OrchestrationV2ThreadDetailSnapshot,
@@ -2367,6 +2368,51 @@
+ it.effect("caches a running thread once when its view closes, not on each update", () =>
+ Effect.gen(function* () {
+ const scope = yield* Scope.make();
+ const harness = yield* makeHarness().pipe(Effect.provideService(Scope.Scope, scope));
+ const running: OrchestrationV2ThreadProjection = {
+ ...BASE_PROJECTION,
+ runs: [
+ {
+ id: RunId.make("run-running"),
+ threadId: THREAD_ID,
+ ordinal: 1,
+ providerInstanceId: BASE_PROJECTION.thread.providerInstanceId,
+ modelSelection: BASE_PROJECTION.thread.modelSelection,
+ providerThreadId: null,
+ userMessageId: MessageId.make("message-running"),
+ rootNodeId: null,
+ activeAttemptId: null,