From 645e6dbe3c9b71814b24d20a62208d99f7ed4fd4 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Tue, 17 Feb 2026 19:45:11 +0000 Subject: [PATCH] Fix missing root-level fallback for turns in parseThreadSnapshot When the API returns a flat response (threadId at root level instead of nested under thread), parseThreadSnapshot correctly fell back to reading threadId from the root but silently defaulted turns to []. This caused checkpoint listings to return no checkpoints and revert operations to use a messageCount of zero, leading to data loss. Add a fallback to read turns from the root-level response, matching the existing fallback pattern used for threadId. --- apps/server/src/codexAppServerManager.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/server/src/codexAppServerManager.ts b/apps/server/src/codexAppServerManager.ts index 01722a6966..39eab1d25a 100644 --- a/apps/server/src/codexAppServerManager.ts +++ b/apps/server/src/codexAppServerManager.ts @@ -795,7 +795,7 @@ export class CodexAppServerManager extends EventEmitter { const turn = this.readObject(turnValue); const turnId = this.readString(turn, "id") ?? `${threadId}:turn:${index + 1}`;