Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): unload Codex threads left idle on the shared app-server #16917

MergedRhysSullivan(GitHub profile, opens in a new tab)merged 2 commits intomain fromrefs/pull/16917/headmerged by juliusmarminge View on GitHub

Showing 2 changed files with 207 additions and 0 deletions (loading 1).

x
0 of 2 viewed, 2 left
207 additions and 0 deletionsapps/server/src/orchestration-v2/ProviderSessionManager.test.tsModified
View file
@@ -319,6 +319,7 @@
readonly initialProviderItemIdentityVersion?: 2;
}) => Effect.Effect<void>;
readonly hasPendingBackgroundWork?: Effect.Effect<boolean>;
+ readonly hasPendingBackgroundWorkForThread?: Effect.Effect<boolean>;
readonly hangSessionScopeClose?: boolean;
readonly startTurn?: Effect.Effect<void>;
readonly beforeUnload?: Effect.Effect<void>;
@@ -407,6 +408,11 @@
...(options.hasPendingBackgroundWork === undefined
? {}
: { hasPendingBackgroundWork: options.hasPendingBackgroundWork }),
+ ...(options.hasPendingBackgroundWorkForThread === undefined
+ ? {}
+ : {
+ hasPendingBackgroundWorkForThread: () => options.hasPendingBackgroundWorkForThread!,
+ }),
ensureThread: () => unimplemented("ensureThread unused in test"),
resumeThread: (threadInput) =>
Ref.update(state, (current) => ({
@@ -463,6 +469,7 @@
readonly paused: Deferred.Deferred<void>;
readonly hasPendingBackgroundWork?: Effect.Effect<boolean>;
+ readonly hasPendingBackgroundWorkForThread?: Effect.Effect<boolean>;
readonly hangSessionScopeClose?: boolean;
readonly startTurn?: Effect.Effect<void>;
readonly beforeUnload?: Effect.Effect<void>;