From 16fd173cb972d549f58c8b67a4e6067bd0b19914 Mon Sep 17 00:00:00 2001 From: Julius Marminge <51714798+juliusmarminge@users.noreply.github.com> Date: Thu, 24 Sep 2026 15:09:30 -0700 Subject: [PATCH] fix(codex): replay legacy user-input requests as blocking Codex 0.156 requires `isBlocking` on `item/tool/requestUserInput`, and its own deserializer defaults a missing value to true for older clients. Transcripts recorded before 0.156 omit it, so the replay client rejected the request and the Codex plan_questions fixture stalled until its 60 second deadline. Co-Authored-By: Claude Opus 5.5 (1M context) --- packages/effect-codex-app-server/src/replay.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/packages/effect-codex-app-server/src/replay.ts b/packages/effect-codex-app-server/src/replay.ts index d3f4ea8b47b6..7d40e138e839 100644 --- a/packages/effect-codex-app-server/src/replay.ts +++ b/packages/effect-codex-app-server/src/replay.ts @@ -313,6 +313,18 @@ function normalizeLegacyInboundFrame(value: unknown): unknown { } normalized.params = params; } + if ( + normalized.method === "item/tool/requestUserInput" && + typeof normalized.params === "object" && + normalized.params !== null + ) { + const params = { ...(normalized.params as Record) }; + // Codex treats a legacy request without `isBlocking` as blocking. + if (params.isBlocking === undefined) { + params.isBlocking = true; + } + normalized.params = params; + } return normalized; }