Summary
On OpenClaw 2026.6.1, a native/OpenClaw-runtime openai-chatgpt-responses session can succeed on the first turn and then fail on the next turn with a provider-side 400 invalid_encrypted_content before any model output.
The user-visible error is sanitized to:
LLM request failed: provider rejected the request schema or tool payload.
The raw trajectory error is:
Codex error: {"type":"error","error":{"type":"invalid_request_error","code":"invalid_encrypted_content","message":"The encrypted content gAAA... could not be verified. Reason: Encrypted content could not be decrypted or parsed."},"status":400}
Environment
- OpenClaw:
2026.6.1 (2e08f0f)
- macOS:
26.4.1 arm64
- Node:
25.9.0
- Runtime / harness: OpenClaw native (
agentRuntime.id = "openclaw")
- Provider/model shape:
{
"provider": "openai",
"model": "gpt-5.5",
"api": "openai-chatgpt-responses",
"baseUrl": "https://chatgpt.com/backend-api/codex",
"agentRuntime": { "id": "openclaw" },
"params": { "thinking": "xhigh", "transport": "sse" }
}
Reproduction observed
- Start a fresh session using
openai/gpt-5.5 with api=openai-chatgpt-responses and native runtime.
- Send a first turn that causes a normal model response and tool use. This succeeds.
- The successful assistant turn stores a
thinking block with thinkingSignature containing a serialized Responses reasoning item with encrypted_content.
- Send a second turn in the same session.
- OpenClaw replays the prior assistant reasoning item in the submitted history.
- The ChatGPT/Codex backend rejects the request before model output with
400 invalid_encrypted_content.
This explains why the previous turn succeeds but the next turn fails.
What I found in dist
openai-chatgpt-responses requests encrypted reasoning:
// openai-chatgpt-responses-*.js
include: ["reasoning.encrypted_content"]
sanitizeSessionHistory only drops reasoning history when the provider replay policy says so:
const droppedReasoning = policy.dropReasoningFromHistory
? dropReasoningFromHistory(validatedThinkingSignatures)
: validatedThinkingSignatures;
But buildOpenAIReplayPolicy(ctx) currently treats openai-chatgpt-responses as a Responses-family API with synthetic tool results, and does not set dropReasoningFromHistory for this API.
Local mitigation that fixed it
Adding this to buildOpenAIReplayPolicy(ctx) fixed the same session immediately:
...ctx.modelApi === "openai-chatgpt-responses" ? { dropReasoningFromHistory: true } : {},
After restarting the gateway, the same session and same message completed successfully. The submitted history no longer contained thinkingSignature; only the old failed assistant turn's plain-text errorMessage still contained the string invalid_encrypted_content, which is harmless.
Expected behavior
For openai-chatgpt-responses against the ChatGPT/Codex backend, OpenClaw should not replay stale/unverifiable encrypted reasoning content, or should retry safely without it before surfacing an error.
Actual behavior
The next turn replays encrypted reasoning content and the backend rejects the whole request with 400 invalid_encrypted_content, resulting in an empty/non-deliverable assistant turn.
Related
Summary
On OpenClaw 2026.6.1, a native/OpenClaw-runtime
openai-chatgpt-responsessession can succeed on the first turn and then fail on the next turn with a provider-side400 invalid_encrypted_contentbefore any model output.The user-visible error is sanitized to:
The raw trajectory error is:
Environment
2026.6.1(2e08f0f)26.4.1arm6425.9.0agentRuntime.id = "openclaw"){ "provider": "openai", "model": "gpt-5.5", "api": "openai-chatgpt-responses", "baseUrl": "https://chatgpt.com/backend-api/codex", "agentRuntime": { "id": "openclaw" }, "params": { "thinking": "xhigh", "transport": "sse" } }Reproduction observed
openai/gpt-5.5withapi=openai-chatgpt-responsesand native runtime.thinkingblock withthinkingSignaturecontaining a serialized Responses reasoning item withencrypted_content.400 invalid_encrypted_content.This explains why the previous turn succeeds but the next turn fails.
What I found in dist
openai-chatgpt-responsesrequests encrypted reasoning:sanitizeSessionHistoryonly drops reasoning history when the provider replay policy says so:But
buildOpenAIReplayPolicy(ctx)currently treatsopenai-chatgpt-responsesas a Responses-family API with synthetic tool results, and does not setdropReasoningFromHistoryfor this API.Local mitigation that fixed it
Adding this to
buildOpenAIReplayPolicy(ctx)fixed the same session immediately:After restarting the gateway, the same session and same message completed successfully. The submitted history no longer contained
thinkingSignature; only the old failed assistant turn's plain-texterrorMessagestill contained the stringinvalid_encrypted_content, which is harmless.Expected behavior
For
openai-chatgpt-responsesagainst the ChatGPT/Codex backend, OpenClaw should not replay stale/unverifiable encrypted reasoning content, or should retry safely without it before surfacing an error.Actual behavior
The next turn replays encrypted reasoning content and the backend rejects the whole request with
400 invalid_encrypted_content, resulting in an empty/non-deliverable assistant turn.Related
openai-codexnative Responses encrypted reasoning replay)