Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): switching providers no longer refuses while the old one runs background work #45373

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

Showing 2 changed files with 31 additions and 2 deletions.

x
0 of 2 viewed, 2 left
27 additions and 2 deletionsapps/server/src/orchestration-v2/testkit/ProviderSwitch.integration.test.tsModified
View file
@@ -4581,9 +4581,13 @@
{ background: false, queued: false, sharedHistory: false },
- "refuses the hand-off while the previous instance still runs background work",
+ "keeps a busy previous session running when a hand-off starts",
{ background: true, queued: false, sharedHistory: false },
+ [
+ "refuses an account switch while the replaced session still runs background work",
+ { background: true, queued: false, sharedHistory: true },
+ ],
"keeps a busy previous session running when a queued hand-off starts",
{ background: true, queued: true, sharedHistory: false },
@@ -4756,6 +4760,27 @@
assert.equal(firstSession?.status, "ready");
+ if (background && !sharedHistory) {
+ yield* send(2, secondSelection);
+ yield* worker.drain();
+ const afterHandoff = yield* waitForIdle(handoffThreadId);
+ assert.deepEqual(
+ afterHandoff.runs.map((run) => [run.providerInstanceId, run.status]),
+ [
+ [CLAUDE_MODEL_SELECTION.instanceId, "completed"],
+ [secondSelection.instanceId, "completed"],
+ ],