diff --git a/packages/client-runtime/src/state/threadWorkflows.test.ts b/packages/client-runtime/src/state/threadWorkflows.test.ts index 23722260b8839..85e5459cdb8d7 100644 --- a/packages/client-runtime/src/state/threadWorkflows.test.ts +++ b/packages/client-runtime/src/state/threadWorkflows.test.ts @@ -63,7 +63,7 @@ describe("thread workflows", () => { ...projection, providerThreads: [{ ...projection.providerThreads[0]!, nativeThreadRef: null }], }), - ).toBe(false); + ).toBe(true); }); it("sorts queued messages and gates reorder and promotion from capabilities", () => { diff --git a/packages/client-runtime/src/state/threadWorkflows.ts b/packages/client-runtime/src/state/threadWorkflows.ts index 69e691840b89e..7ff1043eb2212 100644 --- a/packages/client-runtime/src/state/threadWorkflows.ts +++ b/packages/client-runtime/src/state/threadWorkflows.ts @@ -93,17 +93,10 @@ export function threadSupportsProviderHandoff(projection: Projection | null | un return session.capabilities.sessions.supportsProviderSwitchingViaHandoff; } if (resolveActiveThreadRun(projection) !== null) return false; - if (projection.thread.historyOrigin === "v1_import" || projection.runs.length === 0) return true; - // Detaching a stopped session removes it from the projection, but its native - // provider thread remains available for the next turn's portable handoff. - return projection.providerThreads.some( - (thread) => - thread.id === projection.thread.activeProviderThreadId && - thread.appThreadId === projection.thread.id && - thread.providerInstanceId === projection.thread.modelSelection.instanceId && - thread.nativeThreadRef !== null, - ); + // With no live session the server plans a portable handoff from saved app + // history, so the outgoing provider's native thread ref is not required. + return true; } export function getUserQueuedThreadRuns(