Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): T3 write tools keep working after switching a thread's provider and back #27206

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

Showing 1 changed file with 119 additions and 0 deletions.

x
0 of 1 viewed, 1 left
119 additions and 0 deletionsapps/server/src/orchestration-v2/testkit/ProviderSwitch.integration.test.tsModified
View file
@@ -2662,6 +2662,125 @@
+ // A shared Codex session that stays attached keeps the other provider's MCP credential.
+ it.live("detaches the left provider's session when a sent message switches providers", () =>
+ Effect.scoped(
+ Effect.gen(function* () {
+ const cwd = yield* checkpointWorkspace("direct-provider-switch-detach");
+ const capturedTurns = yield* Ref.make<ReadonlyArray<CapturedTurn>>([]);
+ const layerRegistry = ProviderAdapterRegistry.layerFromAdapters([
+ makeTestAdapter({
+ instanceId: CODEX_MODEL_SELECTION.instanceId,
+ driver: CODEX_DRIVER,
+ capabilities: CodexProviderCapabilitiesV2,
+ modelSelection: CODEX_MODEL_SELECTION,
+ responseByRunOrdinal: {},
+ capturedTurns,
+ }),
+ makeTestAdapter({
+ instanceId: CLAUDE_MODEL_SELECTION.instanceId,
+ driver: CLAUDE_DRIVER,
+ capabilities: ClaudeProviderCapabilitiesV2,
+ modelSelection: CLAUDE_MODEL_SELECTION,
+ responseByRunOrdinal: {},
+ capturedTurns,
+ }),
+ ]);
+ const layerDatabase = SqlitePersistence.layerMemory;
+ const layerOutboxProvided = EffectOutbox.layer.pipe(Layer.provide(layerDatabase));