Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): released provider sessions are marked stopped after their thread detaches #17481

Closedfireboltdude1357(GitHub profile, opens in a new tab)wants to merge 2 commits intomain fromrefs/pull/17481/headopened View on GitHub

Showing 8 changed files with 41 additions and 0 deletions (loading 7).

x
0 of 8 viewed, 8 left
41 additions and 0 deletionsapps/server/src/orchestration-v2/ProjectionStore.tsModified
View file
@@ -22,6 +22,7 @@
OrchestrationV2ConversationMessage,
OrchestrationV2DomainEvent,
OrchestrationV2ProjectedTurnItem,
+ OrchestrationV2ProviderSession,
OrchestrationV2ProviderThread,
OrchestrationV2ProviderTurn,
OrchestrationV2Run,
@@ -496,6 +497,19 @@
ReadonlyArray<ThreadId>,
ProjectionStoreV2Error
+ /**
+ * Sessions not stopped or failed that no thread is bound to, each with the
+ * thread that last wrote it. Startup recovery stops them: no runtime
+ * survives a restart, and recovery otherwise finds sessions only through
+ * their bindings.
+ */
+ readonly getUnboundLiveProviderSessions: () => Effect.Effect<
+ ReadonlyArray<{
+ readonly threadId: ThreadId;
+ readonly session: OrchestrationV2ProviderSession;
+ }>,
+ ProjectionStoreV2Error
+ >;
readonly getThreadSnapshot: (threadId: ThreadId) => Effect.Effect<
readonly schemaVersion: number;