Description
When using gpt-5.2-codex with thinking enabled (thinkingLevel: low), the agent breaks after the second message in every session with a 400 error from the OpenAI Responses API.
Error
400 Item 'rs_<id>' of type 'reasoning' was provided without its required following item.
Steps to Reproduce
- Use
gpt-5.2-codex as the primary model with thinkingLevel: low
- Send a message to the agent (it responds fine — reasoning block + tool calls on first turn, reasoning block + text on second turn)
- Send a second message
- The 400 error fires immediately — every subsequent message fails
Root Cause
The first assistant turn contains a reasoning block (rs_...) followed by tool calls. When the next user message arrives, openclaw reconstructs the full conversation history and sends it to the OpenAI Responses API. The API rejects the request because the reasoning block from turn 1 is now considered "orphaned" — it is not immediately followed by a text response.
The OpenAI Responses API requires that reasoning items in the input array be immediately followed by their paired content. Reasoning blocks paired only with tool calls (without a subsequent text response in the same turn) appear to violate this constraint when replayed in conversation history.
Workaround
Setting thinkingLevel: off prevents the issue entirely. Alternatively, manually creating a new session JSONL file and updating sessions.json clears the broken state, but it recurs on the next session start with thinking enabled.
Environment
- openclaw:
2026.2.15
- Model:
openai/gpt-5.2-codex
- API:
openai-responses
- OS: Fedora Linux (x86_64)
Description
When using
gpt-5.2-codexwith thinking enabled (thinkingLevel: low), the agent breaks after the second message in every session with a 400 error from the OpenAI Responses API.Error
Steps to Reproduce
gpt-5.2-codexas the primary model withthinkingLevel: lowRoot Cause
The first assistant turn contains a reasoning block (
rs_...) followed by tool calls. When the next user message arrives, openclaw reconstructs the full conversation history and sends it to the OpenAI Responses API. The API rejects the request because the reasoning block from turn 1 is now considered "orphaned" — it is not immediately followed by a text response.The OpenAI Responses API requires that reasoning items in the
inputarray be immediately followed by their paired content. Reasoning blocks paired only with tool calls (without a subsequent text response in the same turn) appear to violate this constraint when replayed in conversation history.Workaround
Setting
thinkingLevel: offprevents the issue entirely. Alternatively, manually creating a new session JSONL file and updatingsessions.jsonclears the broken state, but it recurs on the next session start with thinking enabled.Environment
2026.2.15openai/gpt-5.2-codexopenai-responses