Repository navigation
Description
Summary
On OpenClaw 2026.6.1, an OpenAI OAuth-backed ChatGPT/Codex provider configured for the Pi/native runtime (agentRuntime.id = openclaw, i.e. the pi alias) is routed to the new boundary-aware unified OpenAI transport instead of the existing ChatGPT Codex stream.
That unified path fails against https://chatgpt.com/backend-api/codex/responses with a provider response that looks like HTTP 200 but has an empty content-type and a raw/normalized Connection error.. The agent then fails with FailoverError: LLM request failed: network connection error.
Environment
- OpenClaw:
2026.6.1(openclaw --versionreportedOpenClaw 2026.6.1 (2e08f0f)) - OS: macOS 26.4.1 arm64
- Node: 25.9.0
- Provider auth: OpenAI OAuth profile (
openai:<redacted-email>) - Model provider:
openai - Runtime: Pi/native (
agentRuntime.id = openclaw;pinormalizes toopenclaw)
Redacted config shape
{
"models": {
"providers": {
"openai": {
"api": "openai-chatgpt-responses",
"baseUrl": "https://chatgpt.com/backend-api/codex",
"agentRuntime": { "id": "openclaw" },
"request": { "allowPrivateNetwork": true }
}
}
},
"agents": {
"defaults": {
"model": { "primary": "openai/gpt-5.5", "fallbacks": [] },
"models": {
"openai/gpt-5.5": {
"agentRuntime": { "id": "openclaw" },
"params": { "thinking": "xhigh", "transport": "sse" }
}
}
}
}
}Reproduction
With the above shape and an OpenAI OAuth profile:
openclaw agent --agent main --session-key agent:main:repro --message 'Reply with exactly OK.' --timeout 180Actual behavior without local patch
The run fails:
GatewayClientRequestError: FailoverError: LLM request failed: network connection error.
Trajectory shows the run being routed to the boundary-aware unified path:
context.compiled: streamStrategy=boundary-aware:openai-chatgpt-responses transport=sse
model.completed: stopReason=error errorMessage="Connection error." usage=input=0/output=0
session.ended: status=error terminalError=non_deliverable_terminal_turn
Local debug of the same native path showed the internal transport alias and invalid response framing:
[openai-transport] [responses] start provider=openai api=openclaw-openai-responses-transport model=gpt-5.5 baseUrl=https://chatgpt.com/backend-api/codex
[provider-transport-fetch] response status=200 contentType=
[openai-transport] [responses] error causeName=ProviderHttpError causeCode=invalid_provider_content_type message=Connection error.
Expected behavior
For openai + openai-chatgpt-responses + ChatGPT Codex baseUrl + OpenAI OAuth + Pi/native runtime, the embedded agent should use the existing ChatGPT Codex native stream strategy (observed as openclaw-native-codex-responses) or otherwise send/parse the ChatGPT Codex endpoint with the correct protocol/headers.
Evidence that this is a transport regression
Using the same OAuth profile, same baseUrl, same model config, and same network/TUN setup, forcing the embedded agent back to the old ChatGPT Codex stream succeeds:
context.compiled: streamStrategy=openclaw-native-codex-responses transport=sse
model.completed: stopReason=stop errorMessage=None
assistant output: OK
Both main and system-architect smoke tests returned OK after the workaround.
Local workaround used
A local dist workaround was needed to prevent the ChatGPT Codex provider from being captured by the unified boundary-aware transport:
- Skip provider stream registration for
model.provider === "openai" && model.api === "openai-chatgpt-responses". - Force
resolveOpenClawNativeCodexResponsesStreamFn(...)to returnstreamSimpleforopenai-chatgpt-responses. - Prevent
createOpenAIAttributionHeadersWrapper(...)from swapping the ChatGPT stream intocreateOpenAIResponsesTransportStreamFn().
This workaround is intentionally narrow to openai-chatgpt-responses; ordinary OpenAI API-key openai-responses, Anthropic, and Codex app-server runtime paths are not the target.
Why this looks like an upstream bug
There appears to already be a special openclaw-native-codex-responses path for this provider/API combination, but in 2026.6.1 the provider stream / OpenAI wrapper / boundary-aware selection path wins first and sends the request through openclaw-openai-responses-transport, which does not currently handle the ChatGPT Codex endpoint response correctly.
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Activity
clawsweeper commentedon Jun 4, 2026
Codex review: keeping this open for maintainer follow-up; there is still a little grit to resolve. Reviewed June 3, 2026, 9:10 PM ET / 01:10 UTC.
Summary
Codex review failed: timeout.
Reproducibility: unclear. The review failed before ClawSweeper could establish a reproduction path.
Ways to help us reproduce this
Next step
Review did not complete, so no work-lane recommendation was made.
Review details
Best possible solution:
Retry the Codex review after fixing the execution failure.
Do we have a high-confidence way to reproduce the issue?
Unclear. The review failed before ClawSweeper could establish a reproduction path.
Is this the best way to solve the issue?
Unclear. Retry the review first so ClawSweeper can evaluate the actual issue and fix direction.
AGENTS.md: unclear because the file could not be read completely.
Remaining risk / open question:
Codex review notes: model gpt-5.5, reasoning high; reviewed against 4fbc318e307f.
Label changes
Label changes:
issue-rating: 🦪 silver shellfish: Current issue advisory state selects this label.clawsweeper:needs-info: Current issue advisory state selects this label.Evidence reviewed
What I checked:
Likely related people:
How this review workflow works
@clawsweeper re-reviewcomments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.@clawsweeper re-reviewor@clawsweeper re-runon an open PR or issue to request a fresh review only.@clawsweeper reviewto request a fresh review only.@clawsweeper autofix,@clawsweeper automerge,@clawsweeper fix ci, or@clawsweeper address review.@clawsweeper explainto ask for more context, or@clawsweeper stopto stop active automation.aaajiao commentedon Jun 6, 2026
Fixed by #90205 (merged in ab0a633), which tolerates a missing
content-typeheader on streamed Codex/ChatGPT Responses replies by sniffing the body and only fast-failing on actual HTML — so valid SSE/JSON with no header now passes through instead of hittinginvalid_provider_content_type.Note: the fix is not in stable
v2026.6.1yet; it first lands in thev2026.6.5-beta.1prerelease. This can be closed once that ships to stable (or now, as already-fixed-on-main).richardmqq commentedon Jun 13, 2026
Verified fixed on stable
2026.6.6(OpenClaw 2026.6.6 (8c802aa)).Post-upgrade validation on macOS:
openclaw status --deep --require-rpcreports gateway app2026.6.6, LaunchAgent loaded/running, update up to date.openai/gpt-5.4no-delivery smoke passed formain:OPENAI_NATIVE_TURN1_OKOPENAI_NATIVE_TURN2_OKagentHarnessId=openclawopenai/gpt-5.4no-delivery smoke passed forsystem-architect:SA_OPENAI_NATIVE_OKagentHarnessId=openclawThis confirms the Pi/OpenClaw native ChatGPT Responses transport no longer fails before useful model output on the stable build that includes the upstream fix noted above.