Skip to content

Commit 0b1394e

Browse files
fix(server): side chats no longer show a self-handoff row for copied context
A side chat of a busy parent recorded its portable fork context as a handoff turn item, so clients rendered 'Context handoff <model> -> <model>' under the 'Context from' divider. A side chat of an idle parent records no such row. Skip the row for side chats; the handoff itself still reaches the provider through the run and the transfer resolution. AI-assisted; verified with the tests and tools listed above. Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent e09bee2 commit 0b1394e

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

‎apps/server/src/orchestration-v2/Orchestrator.ts‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8333,7 +8333,9 @@ const makeOrchestrator = Effect.fn("orchestrationV2.Orchestrator.layer")(functio
83338333
)
83348334
: {}),
83358335
};
8336-
const activeHandoff = portableForkHandoff ?? mergeBackHandoff ?? providerSwitchHandoff;
8336+
// A side chat's "Context from" divider already marks its copied context.
8337+
const activeHandoff =
8338+
(sideChatFork ? null : portableForkHandoff) ?? mergeBackHandoff ?? providerSwitchHandoff;
83378339
const handoffSourceRuns =
83388340
portableForkHandoff !== null
83398341
? sourceRun === null

‎apps/server/src/orchestration-v2/ThreadFork.execution.test.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -965,6 +965,7 @@ it.effect("a side chat of a busy parent points history recovery at the parent",
965965
const coverage = handoff?.history?.coverage ?? "";
966966
assert.include(coverage, `t3_thread_read({threadId:"${parentId}"`);
967967
assert.notInclude(coverage, `threadId:"${sideChatId}"`);
968+
assert.isFalse(started.turnItems.some((item) => item.type === "handoff"));
968969
}).pipe(Effect.provide(forkCases[0]!.layer)),
969970
);
970971

0 commit comments

Comments
 (0)