Skip to content

Commit 966209c

Browse files
committed
Fix: skip resume cursor when switching providers
Resume cursors are provider-specific opaque state and must not be forwarded across provider boundaries. When providerChanged is true, set resumeCursor to undefined instead of resolving the old provider's cursor, which would be misinterpreted by the new provider.
1 parent eec6d64 commit 966209c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

apps/server/src/orchestration/Layers/ProviderCommandReactor.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ const make = Effect.gen(function* () {
211211
return existingSessionId;
212212
}
213213

214-
const resumeCursor = yield* resolveResumeCursorForSession(existingSessionId);
214+
const resumeCursor = providerChanged ? undefined : (yield* resolveResumeCursorForSession(existingSessionId));
215215
const restartedSession = yield* startProviderSession({
216216
...(resumeCursor !== undefined ? { resumeCursor } : {}),
217217
...(options?.provider !== undefined ? { provider: options.provider } : {}),

0 commit comments

Comments
 (0)