Skip to content

Commit ac86d38

Browse files
fix(pi): only restore a Pi session for rollback when its session file is known
AI-assisted; verified with the tests and tools listed above.
1 parent e36c725 commit ac86d38

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

‎packages/provider-pi/src/server/adapter.ts‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3184,7 +3184,10 @@ export const makePiAdapterV2 = Effect.fn("makePiAdapterV2")(function* (
31843184
function* (rollbackInput) {
31853185
// A fresh runtime (restart or idle release) must load the persisted session before forking.
31863186
// Unpublished: the rollback service persists the returned snapshot.
3187-
if (threadState === null && rollbackInput.providerThread.nativeThreadRef != null) {
3187+
if (
3188+
threadState === null &&
3189+
rollbackInput.providerThread.nativeThreadRef?.nativeId != null
3190+
) {
31883191
yield* registerThread(
31893192
{
31903193
threadId: rollbackInput.providerThread.appThreadId ?? input.threadId,

0 commit comments

Comments
 (0)