The best way to control Claude Code, Codex and more from any computer or phone
fix(clients): allow portable provider handoffs after detach (#24641)
Julius Marminge committed
Nov 13, 2026 at 23:51 UTC
a81ec88f58f618251440dcdc3d2c08884414c7dc
2 files changed
+6
-5
packages/client-runtime/src/state/threadWorkflows.test.ts
+2
-1
@@ -62,7 +62,8 @@ describe("thread workflows", () => {
62
...projection,
63
providerThreads: [{ ...projection.providerThreads[0]!, nativeThreadRef: null }],
64
}),
65
- ).toBe(false);
65
+ ).toBe(true);
66
+ expect(threadSupportsProviderHandoff({ ...projection, providerThreads: [] })).toBe(false);
67
});
68
69
it("sorts queued messages and gates promotion from capabilities", () => {
packages/client-runtime/src/state/threadWorkflows.ts
+4
-4
@@ -109,14 +109,14 @@ export function threadSupportsProviderHandoff(projection: Projection | null | un
109
if (resolveActiveThreadRun(projection) !== null) return false;
110
if (projection.thread.historyOrigin === "v1_import" || projection.runs.length === 0) return true;
111
112
- // Detaching a stopped session removes it from the projection, but its native
113
- // provider thread remains available for the next turn's portable handoff.
112
+ // Detaching a stopped session removes it from the projection. The server still
113
+ // hands off from saved app history, which needs the source provider thread but
114
+ // not its native ref.
115
return projection.providerThreads.some(
116
(thread) =>
117
thread.id === projection.thread.activeProviderThreadId &&
118
thread.appThreadId === projection.thread.id &&
118
- thread.providerInstanceId === projection.thread.modelSelection.instanceId &&
119
- thread.nativeThreadRef !== null,
119
+ thread.providerInstanceId === projection.thread.modelSelection.instanceId,
120
);
121
}
122