Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): a setting change no longer detaches a busy session kept from an earlier hand-off #35258

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

Showing 2 changed files with 149 additions and 2 deletions.

x
0 of 2 viewed, 2 left
136 additions and 0 deletionsapps/server/src/orchestration-v2/testkit/ProviderSwitch.integration.test.tsModified
View file
@@ -3152,6 +3152,142 @@
+ // regression: a session kept by a queued hand-off is probed when a later change detaches it
+ it.live(
+ "refuses a later instance change while a retained hand-off session runs background work",
+ () =>
+ Effect.gen(function* () {
+ const cwd = yield* checkpointWorkspace("retained-session-background");
+ const capturedTurns = yield* Ref.make<ReadonlyArray<CapturedTurn>>([]);
+ const codexBackgroundWork = yield* Ref.make(true);
+ const firstStarted = yield* Deferred.make<void>();
+ const releaseFirst = yield* Deferred.make<void>();
+ const threadId = ThreadId.make("thread:retained-session-background");
+ yield* Effect.gen(function* () {
+ const orchestrator = yield* Orchestrator.OrchestratorV2;
+ const worker = yield* EffectWorker.OrchestrationEffectWorkerV2;
+ const send = (ordinal: number, modelSelection: ModelSelection) =>
+ orchestrator.dispatch({
+ type: "message.dispatch",
+ createdBy: "user",
+ creationSource: "web",
+ commandId: CommandId.make(`command:retained-session-background:${ordinal}`),
+ threadId,
+ messageId: MessageId.make(`message:retained-session-background:${ordinal}`),
+ text: `Prompt ${ordinal}`,
+ attachments: [],
+ modelSelection,
+ dispatchMode: { type: "queue_after_active" },