Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): a queued provider switch no longer ends background work #30401

Mergedjuliusmarmingemerged 1 commit intomain fromrefs/pull/30401/headmerged by juliusmarminge View on GitHub

Showing 2 changed files with 114 additions and 9 deletions (loading 1).

x
0 of 2 viewed, 2 left
114 additions and 9 deletionsapps/server/src/orchestration-v2/testkit/ProviderSwitch.integration.test.tsModified
View file
@@ -2529,21 +2529,36 @@
// regression: #20343 sending to an instance with separate history must release the old session
it.live.each([
- ["detaches the previous instance's session when a send hands off to another instance", false],
- ["refuses the hand-off while the previous instance still runs background work", true],
- ] as const)("%s", ([, backgroundRunning]) =>
+ [
+ "detaches the previous instance's session when a send hands off to another instance",
+ { background: false, queued: false, sharedHistory: false },
+ ],
+ [
+ "refuses the hand-off while the previous instance still runs background work",
+ { background: true, queued: false, sharedHistory: false },
+ ],
+ [
+ "keeps a busy previous session running when a queued hand-off starts",
+ { background: true, queued: true, sharedHistory: false },
+ ],
+ [
+ "holds a queued account switch while the replaced session still runs background work",
+ { background: true, queued: true, sharedHistory: true },
+ ],
+ ] as const)("%s", ([, { background, queued, sharedHistory }]) =>
Effect.scoped(
Effect.gen(function* () {
const cwd = yield* checkpointWorkspace("handoff-releases-session");
const capturedTurns = yield* Ref.make<ReadonlyArray<CapturedTurn>>([]);
- const backgroundWork = yield* Ref.make(backgroundRunning);
+ const backgroundWork = yield* Ref.make(background);