@devries-cameron20 / t3code Mirror · read-only / commits / 55ea365a8f
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 22, 05:45 UTC

fix(server): side chats no longer open with a model switch from the parent's turn (#29752)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

Alex Southwell committed Nov 3, 2026 at 16:36 UTC 55ea365a8f167495e87c76da247be8bf47c5908a
2 files changed +20 -3
apps/server/src/orchestration-v2/Orchestrator.ts
+6 -1
@@ -7274,7 +7274,12 @@ const makeOrchestrator = Effect.fn("orchestrationV2.Orchestrator.layer")(functio
7274 ...(command.context ? { context: command.context } : {}),
7275 attachments: command.attachments,
7276 ...(run.contextHandoffId === null
7277 - ? modelSwitchSince(projection, modelSelection, sourceRun?.modelSelection)
7277 + ? modelSwitchSince(
7278 + projection,
7279 + modelSelection,
7280 + // Side chats do not show the parent's runs.
7281 + sideChatFork ? undefined : sourceRun?.modelSelection,
7282 + )
7283 : {}),
7284 };
7285 const activeHandoff = portableForkHandoff ?? mergeBackHandoff ?? providerSwitchHandoff;
apps/server/src/orchestration-v2/ThreadFork.execution.test.ts
+14 -2
@@ -852,7 +852,11 @@ const forkSideChat = (commandId: string, sourceThreadId: ThreadId, targetThreadI
852 });
853 });
854
855 -const askSideChat = (threadId: ThreadId, commandId: string) =>
855 +const askSideChat = (
856 + threadId: ThreadId,
857 + commandId: string,
858 + modelSelection?: (typeof forkCases)[number]["modelSelection"],
859 +) =>
860 Effect.gen(function* () {
861 const orchestrator = yield* Orchestrator.OrchestratorV2;
862 yield* orchestrator.dispatch({
@@ -862,6 +866,7 @@ const askSideChat = (threadId: ThreadId, commandId: string) =>
866 messageId: MessageId.make(commandId),
867 text: "What is the main thread doing?",
868 attachments: [],
869 + ...(modelSelection === undefined ? {} : { modelSelection }),
870 dispatchMode: { type: "start_immediately" },
871 createdBy: "user",
872 creationSource: "web",
@@ -954,10 +959,17 @@ it.effect("a side chat of an idle parent still starts with the framing note", ()
959 query.includes("FROM orchestration_v2_projection_context_transfers"),
960 ),
961 );
957 - yield* askSideChat(sideChatId, "side-chat-idle-first-message");
962 + yield* askSideChat(sideChatId, "side-chat-idle-first-message", {
963 + ...forkCases[0]!.modelSelection,
964 + model: "side-chat-model",
965 + });
966
967 const started = yield* orchestrator.getThreadProjection(sideChatId);
968 assert.isNotNull(started.providerThreads[0]?.forkedFrom);
969 + // The side chat does not show the parent's run, so it is no baseline.
970 + assert.isFalse(
971 + started.turnItems.some((item) => item.type === "user_message" && item.modelSwitch),
972 + );
973 assert.lengthOf(started.contextHandoffs, 1);
974 const [handoff] = started.contextHandoffs;
975 assert.isTrue(