fix(agents): keep Codex reasoning payloads stateless#4572
Open
kevin-dp wants to merge 1 commit into
Open
Conversation
#4557 forced store: true on both openai and openai-codex reasoning payloads to keep rs_* continuations replayable. But the ChatGPT-login Codex endpoint is stateless-only and rejects any stateful request with {"detail":"Store must be set to false"}, so every Codex (gpt-5.x) run failed at message_end. Scope the stateful default to the regular OpenAI Responses API and leave the Codex payload on the upstream store:false default, restoring pre-#4557 behavior there. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
#4557 forced
store: trueon built-in reasoning payloads for bothopenaiandopenai-codexso OpenAI Responses continuations can replayrs_*reasoning items. But the ChatGPT-login Codex endpoint is stateless-only and hard-rejects any stateful request:Since #4557 merged, every Codex (gpt-5.x via ChatGPT login) run fails immediately, even a plain "Hi" with no tool calls.
Fix
Scope the stateful default to the regular OpenAI Responses API only — the
openai-codexpayload keeps the upstreamstore: falsedefault (pre-#4557 behavior). This means thers_* not foundcontinuation issue #4557 addressed remains possible on Codex, but stateful requests can never work against that endpoint anyway; a stateless fix there would need the encrypted reasoning-content replay path (explicitly a non-goal in #4557).Test plan
pnpm exec vitest run test/model-catalog.test.tsinpackages/agents(15 passed) — adds a regression test thatopenai-codexpayloads get nostoreoverride (and an incomingstore: falsesurvives), while the existingopenaistore-true coverage still passespnpm typecheckclean inpackages/agentsgpt-5.5runs failed with the store error before this change🤖 Generated with Claude Code