Skip to content

[Bug]: 2026.6.1 OpenAI ChatGPT Responses transport fails with invalid_provider_content_type for gpt-5.4/gpt-5.5 #90083

Closed

Description

@jimmielightner

Summary

After upgrading to OpenClaw 2026.6.1 and running the config/plugin migration, OpenAI/ChatGPT Responses inference fails for openai/gpt-5.4 and openai/gpt-5.5 with:

  • causeCode=invalid_provider_content_type
  • api=openclaw-openai-responses-transport
  • message=Connection error

Local vLLM inference succeeds in the same install, and gateway/plugin health is otherwise clean.

Environment

  • OpenClaw: 2026.6.1 2e08f0f
  • OS: Linux 7.0.10-arch1-1 x64
  • Node: 22.22.2
  • Install/update method: npm
  • Gateway: systemd user service, running/reachable
  • Auth: OpenAI OAuth profile reports OK
  • Default model: openai/gpt-5.5
  • Session context shown by status: gpt-5.5 (1000k ctx)

Config shape

The migrated config uses:

{
  "models.providers.openai": {
    "api": "openai-chatgpt-responses",
    "auth": "oauth",
    "baseUrl": "https://chatgpt.com/backend-api"
  },
  "agents.defaults.model": {
    "primary": "openai/gpt-5.5"
  }
}

Configured OpenAI models include:

  • gpt-5.4, api openai-chatgpt-responses, runtime pi
  • gpt-5.5, api openai-chatgpt-responses, runtime pi
  • gpt-5.3-codex, api openai-chatgpt-responses

Reproduction

openclaw infer model run --model openai/gpt-5.5 --prompt "reply OK"
openclaw infer model run --model openai/gpt-5.4 --prompt "reply OK"
openclaw infer model run --model vllm/gemma4-31b --prompt "reply OK"

Actual result

openai/gpt-5.5:

[openai-transport] [responses] error provider=openai api=openclaw-openai-responses-transport model=gpt-5.5 name=Error status=undefined code=undefined type=undefined causeName=ProviderHttpError causeCode=invalid_provider_content_type message=Connection error.
Error: No text output returned for provider "openai" model "gpt-5.5": Connection error..

openai/gpt-5.4:

[openai-transport] [responses] error provider=openai api=openclaw-openai-responses-transport model=gpt-5.4 name=Error status=undefined code=undefined type=undefined causeName=ProviderHttpError causeCode=invalid_provider_content_type message=Connection error.
Error: No text output returned for provider "openai" model "gpt-5.4": Connection error..

openai/gpt-5.3-codex:

[openai-transport] [responses] error provider=openai api=openclaw-openai-responses-transport model=gpt-5.3-codex name=Error status=400 code=undefined type=undefined causeName=undefined causeCode=undefined message=400 status code (no body)

Local vLLM succeeds:

model.run via local
provider: vllm
model: gemma4-31b
outputs: 1
OK

Expected result

openai/gpt-5.4 and openai/gpt-5.5 should return text output, or at least surface the underlying HTTP response/status/body/content-type clearly enough to diagnose.

Notes

This appears distinct from the plugin migration failure mode. Doctor shows plugin registry clean:

  • Plugins loaded: 71
  • Plugin errors: 0
  • no runtime.llm.complete
  • no conflicting legacy plugin index warning after cleanup

This looks like a 2026.6.1 OpenAI/ChatGPT Responses transport issue where the transport expects SSE/JSON but receives another content type from the backend.

A redacted repro bundle is available if useful, but I am not attaching it publicly because it contains local status/log context.

Possibly related historical/current issues:

Activity

  1. clawsweeper commented on Jun 4, 2026

    @clawsweeper
    Contributor

    Codex review: keeping this open for maintainer follow-up; there is still a little grit to resolve. Reviewed June 3, 2026, 9:01 PM ET / 01:01 UTC.

    Summary
    Keep open: the report is a concrete 2026.6.1 OpenAI ChatGPT/Codex Responses transport failure, and current main has the same relevant transport code as the reported release, so there is no source or release evidence that the central problem is already fixed.

    Reproducibility: no. not at high confidence from this review alone: the reporter provided exact commands and logs, and the matching current source path is clear, but a live OpenAI OAuth model call against current main was not run.

    Ways to help us reproduce this

    • Add a screenshot or short recording showing the behavior.
    • Add expected vs actual behavior.

    Next step
    Needs maintainer live repro and owner review before a repair PR because the failure depends on the hidden ChatGPT/Codex Responses transport and may be upstream/protocol-specific.

    Review details

    Best possible solution:

    Keep this open for an owner/live repro that captures a redacted upstream status/content-type/body, then fix either the ChatGPT Responses transport path or the error propagation without adding a new config shape.

    Do we have a high-confidence way to reproduce the issue?

    No, not at high confidence from this review alone: the reporter provided exact commands and logs, and the matching current source path is clear, but a live OpenAI OAuth model call against current main was not run.

    Is this the best way to solve the issue?

    Unclear: improving diagnostics for invalid_provider_content_type is clearly needed, but restoring text output safely requires a live ChatGPT/Codex transport investigation before choosing the final code change.

    AGENTS.md: found and applied where relevant.

    Remaining risk / open question:

    • No live ChatGPT OAuth call was run during this read-only review, so the exact upstream status, body, and content type for current main remain unconfirmed.
    • A root-cause fix may need owner review because this route depends on the ChatGPT/Codex backend contract and Codex-compatible request headers, not only OpenClaw local code.

    Codex review notes: model gpt-5.5, reasoning high; reviewed against d1fef1d50dcb.

    Label changes

    Label changes:

    • add P1: The report describes current-release OpenAI ChatGPT/Codex model inference failing for primary GPT-5.4/GPT-5.5 routes, which can block real agent/model workflows.
    • add impact:auth-provider: The affected path is OpenAI OAuth/ChatGPT Responses provider routing and transport behavior for canonical openai/* models.
    • add issue-rating: 🐚 platinum hermit: Current issue advisory state selects this label.
    • add clawsweeper:needs-live-repro: Current issue advisory state selects this label.
    • add clawsweeper:no-new-fix-pr: Current issue advisory state selects this label.
    • add clawsweeper:needs-maintainer-review: Current issue advisory state selects this label.

    Label justifications:

    • P1: The report describes current-release OpenAI ChatGPT/Codex model inference failing for primary GPT-5.4/GPT-5.5 routes, which can block real agent/model workflows.
    • impact:auth-provider: The affected path is OpenAI OAuth/ChatGPT Responses provider routing and transport behavior for canonical openai/* models.
    Evidence reviewed

    What I checked:

    • Reporter reproduction: The issue gives exact openclaw infer model run commands for openai/gpt-5.5 and openai/gpt-5.4, both failing on 2026.6.1 with causeCode=invalid_provider_content_type through openclaw-openai-responses-transport, while a local vLLM model succeeds in the same install.
    • Current transport throws the reported code: assertOpenAISdkStreamContentType accepts only text/event-stream or JSON for streamed OpenAI-compatible responses, then throws ProviderHttpError with code: "invalid_provider_content_type" when a successful response has another content type. (src/agents/provider-transport-fetch.ts:231, d1fef1d50dcb)
    • Current fetch path can obscure response details: The fetch wrapper records status/content type only in debug output before calling the content-type assertion for streaming requests, matching the report's concern that the surfaced user error is a generic connection failure rather than the underlying upstream response. (src/agents/provider-transport-fetch.ts:741, d1fef1d50dcb)
    • OpenAI ChatGPT simple completions use this transport path: prepareCodexSimpleTransportModel handles provider=openai plus api=openai-chatgpt-responses, normalizes ChatGPT backend URLs to /backend-api/codex, registers the OpenClaw transport stream, and changes the API to openclaw-openai-responses-transport. (src/agents/simple-completion-transport.ts:20, d1fef1d50dcb)
    • No relevant current-main fix after the reported release: The relevant transport and OpenAI docs files have no diff between v2026.6.1 and current HEAD; v2026.6.1 points at the reported release commit, so current main does not show a newer source change that would close this issue. (d1fef1d50dcb)
    • Supported user-facing route: OpenClaw docs describe model run as a provider/auth health probe and list ChatGPT/Codex subscription auth through the OpenClaw runtime as a supported openai/gpt-5.5 route, so this is a supported-path bug rather than an out-of-repo support request. Public docs: docs/providers/openai.md. (docs/providers/openai.md:37, d1fef1d50dcb)

    Likely related people:

    • Peter Steinberger: Current blame and recent history on provider-transport-fetch.ts, simple-completion-transport.ts, and OpenAI transport/docs paths point to recent work on the affected transport and diagnostics surfaces. (role: recent area contributor; confidence: high; commits: 3ad7049cba9d, 7740c4d53050, eb9051cc7c07; files: src/agents/provider-transport-fetch.ts, src/agents/simple-completion-transport.ts, extensions/openai/openai-chatgpt-provider.ts)
    • Vincent Koc: History shows the LLM transport adapter seam and recent release baseline work touching the relevant provider/runtime surfaces. (role: transport seam contributor and release-area contributor; confidence: medium; commits: 4798e125f40c, 2e08f0f4221f, 90fac509875e; files: src/agents/provider-transport-fetch.ts, src/agents/simple-completion-transport.ts, docs/providers/openai.md)
    • Ayaan Zaidi: History links the simple-completion transport registration path to the affected one-shot infer model run behavior. (role: simple-completion transport contributor; confidence: medium; commits: 42e708d0055b; files: src/agents/simple-completion-transport.ts)
    • dorukardahan: History links GPT-5.4 API and Codex OAuth support to the OpenAI provider surface implicated by the report. (role: OpenAI model support contributor; confidence: medium; commits: 5d4b04040d69; files: extensions/openai/openai-chatgpt-provider.ts, docs/providers/openai.md)
    How this review workflow works
    • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
    • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
    • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
    • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
    • Maintainers can also comment @clawsweeper review to request a fresh review only.
    • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
    • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
    • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.
  2. added
    P1High-priority user-facing bug, regression, or broken workflow.
    impact:auth-providerAuth, provider routing, model choice, or SecretRef resolution may break.
    issue-rating: 🐚 platinum hermitGood issue quality with a plausible reproduction path needing some confirmation.
    clawsweeper:needs-live-reproClawSweeper needs live local, crabbox, or manual validation to confirm this issue.
    clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.
    clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.
    on Jun 4, 2026
  3. jimmielightner commented on Jun 4, 2026

    @jimmielightner
    Author

    Thanks. I can add expected vs actual explicitly.

    Expected

    openclaw infer model run --model openai/gpt-5.5 --prompt "reply OK" should return a normal text completion, comparable to the local vLLM control returning OK.

    Actual

    The command fails before any text output:

    [openai-transport] [responses] error provider=openai api=openclaw-openai-responses-transport model=gpt-5.5 name=Error status=undefined code=undefined type=undefined causeName=ProviderHttpError causeCode=invalid_provider_content_type message=Connection error.
    Error: No text output returned for provider "openai" model "gpt-5.5": Connection error..
    

    Same pattern for openai/gpt-5.4.

    The local control succeeds:

    openclaw infer model run --model vllm/gemma4-31b --prompt "reply OK"
    
    model.run via local
    provider: vllm
    model: gemma4-31b
    outputs: 1
    OK
    

    I do not have the upstream response content-type/body yet. OPENCLAW_DEBUG_PROVIDER=1 and DEBUG="openclaw:*" did not surface additional response details beyond the same invalid_provider_content_type line.

    The preserved 2026.6.1 snapshot is available, so I can run a one-off diagnostic build/patch if useful. In particular, I can capture a redacted response.status, response.headers.get("content-type"), and the first N bytes of the response body, with auth headers/tokens redacted. If there is a preferred debug flag, patch, or command sequence for that, I can run it against the snapshot.

  4. bushinconsulting commented on Jun 4, 2026

    @bushinconsulting

    Confirming this on 2026.6.1 / commit 2e08f0f, ChatGPT Plus OAuth profile.

    Tracked it down to a payload-shape mismatch — openclaw-openai-responses-transport
    doesn't emit the contract that chatgpt.com/backend-api/codex/responses enforces.
    Below is a fully reproducible curl that works against the codex endpoint
    using the same OAuth profile OpenClaw stores, isolating the issue to transport
    payload shape (not auth, not headers, not routing).

    Working curl
    ACCESS=$(jq -r '.profiles["openai:"].access'
    ~/.openclaw/agents/main/agent/auth-profiles.json)
    ACCOUNT=$(jq -r '.profiles["openai:"].accountId'
    ~/.openclaw/agents/main/agent/auth-profiles.json)

    curl -sS -i -N -X POST 'https://chatgpt.com/backend-api/codex/responses'
    -H "Authorization: Bearer $ACCESS"
    -H "chatgpt-account-id: $ACCOUNT"
    -H "OpenAI-Beta: responses=experimental"
    -H "Content-Type: application/json"
    -H "Accept: text/event-stream"
    -H "originator: codex_cli_rs"
    -d '{
    "model": "gpt-5.4",
    "stream": true,
    "store": false,
    "instructions": "You are a terse assistant.",
    "input": [{"role":"user","content":[{"type":"input_text","text":"say hi"}]}]
    }'

    → HTTP/2 200, content-type: text/event-stream, full SSE response with deltas
    and response.completed. x-codex-plan-type: plus, x-codex-active-limit: premium.

    Required payload diff (versus OpenAI Platform /v1/responses)

    Field Required by codex backend
    instructions at top level YES — system content cannot live in input[]
    store: false at top level YES — codex backend manages its own conversation state

    Empirically discovered by iterating on error responses:

    1. First attempt → 400 {"detail":"Instructions are required"}
    2. After adding top-level instructions → 400 {"detail":"Store must be set to false"}
    3. After adding store: false → 200 SSE stream succeeds

    What's missing in OpenClaw's transport

    openclaw-openai-responses-transport puts system content inside input[]
    as a system role and omits store. Both work fine against

  5. toruvieI commented on Jun 4, 2026

    @toruvieI
    Contributor

    I can confirm that this also affects my configuration after upgrading to 2026.6.1 :(

    Logs proof:

    11:26:47+02:00 warn openai-transport {"subsystem":"openai-transport"} [responses] error provider=openai api=openai-chatgpt-responses model=gpt-5.5 name=Error status=undefined code=undefined type=undefined causeName=ProviderHttpError causeCode=invalid_provider_content_type message=Connection error.
    11:26:47+02:00 warn agent/embedded {"subsystem":"agent/embedded"} {"event":"embedded_run_agent_end","tags":["error_handling","lifecycle","agent_end","assistant_error"],"runId":"active-memory-mpzajrax-a65795d4","isError":true,"error":"LLM request failed: network connection error.","failoverReason":"timeout","model":"gpt-5.5","provider":"openai","rawErrorPreview":"Connection error.","rawErrorHash":"sha256:8ec9a0b7fe5c","providerRuntimeFailureKind":"timeout"} embedded run agent end
    

    Unfortunately this is one of the many problems, caused by pushing on openclaw openai.com codex runtime, as documented here: #88706

    The amount of the problems this is causing is really bad :(

    @bushinconsulting could you please finish your comment? Do you have a full patch/workaround ?

  6. toruvieI commented on Jun 4, 2026

    @toruvieI
    Contributor

    @clawsweeper re-review
    This is a critical regression on 2026.6.1 causing COMPLETE inability to use openai subscription plans to be used in openclaw.

  7. toruvieI commented on Jun 4, 2026

    @toruvieI
    Contributor

    I reproduced the failing path more closely and found the concrete root cause.

    ChatGPT/Codex Responses can return a valid SSE stream with no content-type header.

    In my 2026.6.1 install, the failing response was:

    status=200
    content-type=
    body starts with:
    event: response.created
    data: {"type":"response.created","response":{"id":"resp_...","status":"in_progress", ...}}
    

    So the backend is not returning garbage. It is returning SSE, but OpenClaw rejects it in the content-type guard before the SDK can parse it.

    The minimal patch is in the active assertOpenAISdkStreamContentType path.

    Allow missing content-type only for successful ChatGPT/Codex Responses streams:

    if (
      !contentType &&
      response.ok &&
      response.body &&
      model.provider === "openai" &&
      model.api === "openai-chatgpt-responses"
    ) {
      return;
    }

    Maybe also include openclaw-openai-responses-transport, but be careful. A broad bypass for all openclaw-openai-responses-transport could hide real bad responses from other OpenAI-compatible routes. This should be narrowly scoped to the ChatGPT/Codex backend, ideally by provider + API + chatgpt.com/backend-api/codex base URL.

    After hot-patching that guard locally, this works again:

    openclaw infer model run --model openai/gpt-5.5 --prompt "reply OK"

    Result:

    provider: openai
    model: gpt-5.5
    outputs: 1
    OK
    

    TRUE ROOT CAUSE:

    It was likely exposed by 4c33aaa86c1673924c9e15c41414ea8af253092f / PR #88451, the OpenAI provider identity unification merged on 2026-05-30. That made the normal openai/gpt-5.4 and openai/gpt-5.5 ChatGPT subscription route go through this OpenClaw Responses transport path.

    Separately: this is exactly the kind of sharp edge we get when OpenAI subscription usage is pushed through Codex/app-server-shaped paths while PI/direct ChatGPT subscription usage gets less attention. The unified openai provider direction is fine, but this route needs first-class live coverage, not only Codex-runtime assumptions. Got to vent 2h lost on debugging it :-)

  8. aaajiao commented on Jun 4, 2026

    @aaajiao
    Contributor

    Independent reproduction — macOS + OrbStack Ubuntu VM, ChatGPT/Codex OAuth, Pi/native runtime. Same invalid_provider_content_type, so this is not isolated to one platform or config.

    Environment

    Symptom (every openai/* model, then fails over)

    [openai-transport] [responses] error provider=openai api=openai-chatgpt-responses model=gpt-5.5
      causeName=ProviderHttpError causeCode=invalid_provider_content_type message=Connection error.
    [agent/embedded] auth profile failure ... provider=openai reason=timeout window=cooldown
    ... FailoverError: LLM request failed: network connection error.   → falls over to opencode/claude-*
    

    Ruled out (the issue is labeled needs-live-repro, so here is what is not the cause)

    1. OAuth is valid. Ran a fresh openclaw models auth login --provider openai; the profile now carries the full access / refresh / expires / accountId / chatgptPlanType fields. No change — still fails identically.
    2. Not the provider override / baseUrl. Removing models.providers.openai.baseUrl, then removing the entire models.providers.openai block, made no difference — consistent with the hardcoded Codex base URL noted in Codex/ChatGPT OAuth: 400 (no body) on openai-chatgpt-responses after upgrade to 2026.6.1 (Windows) #90269.
    3. Network / endpoint / Cloudflare / credential are all healthy. A direct curl from inside the VM to the real endpoint returns a correct response:
      $ curl -i https://chatgpt.com/backend-api/codex/responses
      HTTP/2 405
      content-type: application/json
      allow: POST
      x-oai-request-id: ...
      server: cloudflare
      
      The endpoint is reachable and returns JSON (405 only because curl used GET instead of POST). DNS, IPv4 and IPv6, and the OAuth token are all fine.

    So the failure is specifically inside the boundary-aware unified OpenAI responses transport (openclaw-openai-responses-transport) on the Pi/native runtime path — exactly the route described in #90086 — not the environment, the credential, or the config.

    Last known good

    2026.5.28 (matching #90269's rollback finding). We are staying on 2026.6.1 with an opencode failover for now rather than rolling back, and are happy to test a patched build.

  9. aaajiao commented on Jun 4, 2026

    @aaajiao
    Contributor

    @clawsweeper re-review

  10. km6d5dhhyw-maker commented on Jun 4, 2026

    @km6d5dhhyw-maker

    I’m seeing the same failure signature on OpenClaw 2026.6.1 (2e08f0f).

    Environment:

    • macOS LaunchAgent gateway
    • Gateway bound to 127.0.0.1:18789
    • Model: openai/gpt-5.5
    • Auth: OpenAI OAuth profile
    • Runtime shown in /status: OpenClaw Default
    • Model policy: agents.defaults.models["openai/gpt-5.5"].agentRuntime.id = "openclaw"

    Symptom:

    • Dashboard accepts a message, then only shows typing / no usable reply.
    • Gateway websocket and dashboard connectivity are OK.
    • OAuth usage/quota is visible.
    • After each failed attempt, the OAuth profile enters cooldown.

    Gateway log failure:

    openai-transport [responses] error provider=openai api=openai-chatgpt-responses model=gpt-5.5 causeName=ProviderHttpError causeCode=invalid_provider_content_type message=Connection error.
    

    Then:

    agent/embedded: LLM request failed: network connection error.
    providerRuntimeFailureKind=timeout
    failoverReason=timeout
    fallbackConfigured=false
    model-fallback/decision: requestedProvider=openai requestedModel=gpt-5.5 candidateProvider=openai candidateModel=gpt-5.5 reason=timeout status=408
    

    I exported a sanitized diagnostics bundle with openclaw gateway diagnostics export and can attach it manually if useful.

  11. km6d5dhhyw-maker commented on Jun 4, 2026

    @km6d5dhhyw-maker

    openclaw-diagnostics-20260604-060411.zip

    Attaching the sanitized diagnostics bundle from my repro.

    A few extra notes:

    • The failure reproduces with a tiny prompt like say only: ping.
    • Gateway status reports connectivity OK and the dashboard websocket stays connected.
    • /status shows Model: openai/gpt-5.5 and Runtime: OpenClaw Default.
    • The configured model policy is agents.defaults.models["openai/gpt-5.5"].agentRuntime.id = "openclaw".
    • The actual failure still goes through openai-chatgpt-responses and returns causeCode=invalid_provider_content_type.
    • Each failed attempt pushes the OAuth profile into cooldown, so I’m stopping further probes for now.

    This seems related to #90086 as well, since my target path is the OpenClaw/Pi/native runtime route rather than the Codex app-server runtime.

  12. km6d5dhhyw-maker commented on Jun 4, 2026

    @km6d5dhhyw-maker

    Follow-up from my macOS LaunchAgent repro: confirmed the local compiled hotpatch restores replies.

    What happened:

    • My first source-shaped patch attempt did not apply because the installed bundle was compiled/minified differently.
    • The active file was dist/openai-transport-stream-*.js.
    • After patching the compiled assertOpenAISdkStreamContentType guard to allow a missing content-type only for successful OpenAI ChatGPT/OpenClaw Responses transport streams, the dashboard responded again.
    • Tiny dashboard test returned pong.

    This supports the current root-cause theory: the upstream response is valid stream data, but 2026.6.1 rejects it when content-type is missing.

    Important caveat: this is only a local installed-package hotpatch and will likely be overwritten by update/reinstall. I’m not treating it as a permanent fix.

  13. nexic-hh commented on Jun 5, 2026

    @nexic-hh

    Adding another live repro datapoint from a macOS host on 2026.6.1 (2e08f0f), because this narrows the failing scope further.

    Exact config shape

    • canonical model refs: openai/gpt-*
    • canonical OAuth profile: openai:<redacted> (provider=openai, mode=oauth)
    • no custom models.providers.openai.baseUrl
    • no HTTP_PROXY / HTTPS_PROXY / ALL_PROXY env set
    • gateway + CLI both on 2026.6.1 (2e08f0f)
    • agents.defaults.models["openai/gpt-5.5"].agentRuntime.id = "openclaw"
    • agents.defaults.models["openai/gpt-5.4"].agentRuntime.id = "codex"
    • agents.defaults.models["openai/gpt-5.4-mini"].agentRuntime.id = "codex"

    Fresh one-shot repro

    gpt-5.5 on the explicit OpenClaw compatibility route fails reproducibly:

    openclaw infer model run --gateway --model openai/gpt-5.5 --prompt 'Reply with exactly: GILA-OPENCLAW-55-OK' --json

    Result:

    GatewayClientRequestError: FailoverError: LLM request failed: network connection error.
    

    In the same install, same host, same OAuth profile, a parallel Codex-runtime control succeeds immediately:

    openclaw infer model run --gateway --model openai/gpt-5.4 --prompt 'Reply with exactly: GILA-CODEX-54-OK' --json

    Result:

    {
      "ok": true,
      "capability": "model.run",
      "transport": "gateway",
      "provider": "openai",
      "model": "gpt-5.4",
      "outputs": [
        { "text": "GILA-CODEX-54-OK", "mediaUrl": null }
      ]
    }

    Probe/auth checks

    openclaw models status --probe --probe-provider openai
    openclaw models auth list --provider openai

    Observed:

    • auth profile exists and is valid (not expired)
    • probe for openai/gpt-5.5 reproduces the same failure

    Relevant probe/log lines:

    [openai-transport] [responses] error provider=openai api=openai-chatgpt-responses model=gpt-5.5 name=Error status=undefined code=undefined type=undefined causeName=ProviderHttpError causeCode=invalid_provider_content_type message=Connection error.
    

    and then:

    provider auth state re-warmed (auth-profile-failure)
    

    Why this datapoint matters

    This host is not just "OpenAI OAuth is broken" in general:

    • openai/gpt-5.4 works through agentRuntime.id="codex"
    • openai/gpt-5.5 fails through agentRuntime.id="openclaw"
    • no custom OpenAI base URL or proxy is present locally

    So this looks like a clean repro that the explicit OpenClaw compatibility route for openai/gpt-5.5 is failing, while the preferred native Codex runtime route remains usable on the same machine.

    Krill also confirmed in Discord that this path is theoretically supposed to work on 2026.6.1 (so not just "unsupported config"), but it is not the preferred/default route for day-to-day OpenAI OAuth use.

  14. robertoronderosjr commented on Jun 6, 2026

    @robertoronderosjr

    Three distinct bugs in 2026.6.1 — full root cause + patches (verified end-to-end on 2026-06-06)

    Same gateway version (2026.6.1) but slightly different config shape — provider id is still openai-codex (pre-migration), targeting https://chatgpt.com/backend-api/codex with auth: oauth, api: openai-chatgpt-responses. Same invalid_provider_content_type symptom plus two additional 400s underneath. Root caused all three in the transport bundle and verified local patches restore LLM round-trip end-to-end.

    All three are in /app/dist/openai-transport-stream-<hash>.js. With all three patches applied + the request body shape we expect, the API returns HTTP/2 200 with event: response.created SSE.

    Bug 1 — OPENAI_CODEX_RESPONSES_PROVIDERS hardcoded to ["openai"] excludes other valid provider ids

    Around line 1297:

    const OPENAI_CODEX_RESPONSES_PROVIDERS = new Set(["openai"]);

    isOpenAICodexResponsesModel(model) checks OPENAI_CODEX_RESPONSES_PROVIDERS.has(model.provider). For installs whose provider id is still openai-codex (legacy but not yet migrated by openclaw doctor --fix, OR migrated and kept distinct because the operator has a separate openai provider for API-key paths), isCodexResponses returns false, so the instructions field is never added to the request body (line ~2524: ...isCodexResponses ? { instructions: ... } : {}).

    ChatGPT's backend rejects:

    HTTP/2 400
    {"detail":"Instructions are required"}
    

    Fix (single line):

    - const OPENAI_CODEX_RESPONSES_PROVIDERS = new Set(["openai"]);
    + const OPENAI_CODEX_RESPONSES_PROVIDERS = new Set(["openai","openai-codex"]);

    Caveat for the migration: openclaw doctor --fix migrates models.providers.openai-codex → models.providers.openai, but if the operator already has a canonical openai provider (e.g. for paid API-key paths), the migration deletes the codex config (legacy-config-migrations-*.js ~line 2256). So the operator can't always rename to openai. Either the set above needs more entries, or the migration needs a non-destructive merge path.

    Bug 2 — store field omitted for openai-chatgpt-responses, but API requires it explicitly false

    Around line 308:

    allowsResponsesStore: supportsResponsesStoreField && api !== "openai-chatgpt-responses" && ...

    This makes allowsResponsesStore = false for chatgpt-responses. Then around line 343:

    const explicitStore = ... : capabilities.allowsResponsesStore ? true : void 0;

    → explicitStore = undefined → the store field is omitted from the body. ChatGPT rejects:

    HTTP/2 400
    {"detail":"Store must be set to false"}
    

    Omitting the field is not equivalent to store: false for this endpoint — it must be set explicitly. Fix (single line):

    - capabilities.allowsResponsesStore ? true : void 0;
    + capabilities.allowsResponsesStore ? true : (model.api === "openai-chatgpt-responses" ? false : void 0);

    Bug 3 — assertOpenAISdkStreamContentType rejects valid SSE responses that omit Content-Type

    Around line 720:

    if (!params.response.ok || !params.response.body || isOpenAISdkStreamContentType(contentType)) return;

    ChatGPT's /backend-api/codex/responses returns valid SSE (event: response.created\ndata: {...}) without a Content-Type header. Confirmed by inspecting raw response headers — only x-codex-*, x-oai-request-id, x-openai-proxy-wasm: v0.1, cf-*, no content-type.

    response.headers.get("content-type") ?? "" returns "". isOpenAISdkStreamContentType("") returns false (no match for text/event-stream or JSON). The check throws invalid_provider_content_type — exactly what this issue reports.

    Fix (single line):

    - if (!params.response.ok || !params.response.body || isOpenAISdkStreamContentType(contentType)) return;
    + if (!params.response.ok || !params.response.body || isOpenAISdkStreamContentType(contentType) || (!contentType && params.model.api === "openai-chatgpt-responses")) return;

    The existing "OpenAI-compatible APIs commonly require a /v1 path prefix" hint in the error message is misleading — appending /v1 to https://chatgpt.com/backend-api/codex triggers a Cloudflare bot challenge (403 with cf-mitigated: challenge). The bare path /backend-api/codex is correct; the real issue is the missing-header tolerance.

    Repro proof — same TOKEN/ACCT, hitting the same endpoint

    Working request (HTTP/2 200):

    curl -X POST 'https://chatgpt.com/backend-api/codex/responses' \
      -H "Authorization: Bearer $OAUTH_TOKEN" \
      -H 'Content-Type: application/json' \
      -H 'OpenAI-Beta: codex=v1' \
      -H "chatgpt-account-id: $ACCT" \
      -d '{"model":"gpt-5.5","input":[{"role":"user","content":"hi"}],"instructions":"helpful","store":false,"stream":true}'

    Removing instructions: 400 {"detail":"Instructions are required"}
    Removing store: false: 400 {"detail":"Store must be set to false"}
    Removing stream: true: 400 {"detail":"Stream must be set to true"}

    With all three present + the three transport patches applied, OpenClaw's gateway now delivers gpt-5.5 responses end-to-end through Discord, Telegram, Slack, and WhatsApp channels (verified live).

    Local entrypoint hotfix (until upstream lands)

    For fleet operators stuck on 2026.6.1 right now, an idempotent shell script wired into the container entrypoint:

    F=$(ls /app/dist/openai-transport-stream-*.js | head -1)
    
    grep -q 'new Set(\["openai","openai-codex"\])' "$F" || \
      sed -i 's|new Set(\["openai"\])|new Set(["openai","openai-codex"])|' "$F"
    
    grep -q 'openai-chatgpt-responses" ? false : void 0' "$F" || \
      sed -i 's|capabilities.allowsResponsesStore ? true : void 0;|capabilities.allowsResponsesStore ? true : (model.api === "openai-chatgpt-responses" ? false : void 0);|' "$F"
    
    # patch 3 — use python because pattern has || which conflicts with sed delimiter
    grep -q '!contentType && params.model.api' "$F" || python3 -c "
    p='$F'; s=open(p).read()
    old='if (!params.response.ok || !params.response.body || isOpenAISdkStreamContentType(contentType)) return;'
    new='if (!params.response.ok || !params.response.body || isOpenAISdkStreamContentType(contentType) || (!contentType && params.model.api === \"openai-chatgpt-responses\")) return;'
    open(p,'w').write(s.replace(old,new,1))"

    Happy to send a PR if it's useful to have the fixes in proper code form.

  15. aaajiao commented on Jun 6, 2026

    @aaajiao
    Contributor

    Fixed by #90205 (merged in ab0a633), which tolerates a missing content-type header 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 hitting invalid_provider_content_type.

    Note: the fix is not in stable v2026.6.1 yet; it first lands in the v2026.6.5-beta.1 prerelease. This can be closed once that ships to stable (or now, as already-fixed-on-main).

  16. khalil-omer commented on Jun 8, 2026

    @khalil-omer

    Adding a live repro (this issue is tagged needs-live-repro) plus a root cause and a minimal working patch. Confirmed on Linux (so not macOS-specific), ChatGPT Pro OAuth, openclaw (pi/native) runtime, openai/gpt-5.5.

    Environment

    • OpenClaw 2026.6.1 (2e08f0f), core + @openclaw/codex both 2026.6.1
    • Ubuntu 24.04, Node 22
    • Auth: ChatGPT Pro OAuth profile (canonical openai provider, api openai-chatgpt-responses), no API key
    • Model: openai/gpt-5.5, agentRuntime.id = openclaw

    Live upstream repro (the requested redacted status/content-type/body)

    Direct curl to the same endpoint the gateway hits, with the account's OAuth bearer + chatgpt-account-id:

    POST https://chatgpt.com/backend-api/codex/responses   (body: {... "store": false, "stream": true})
    → HTTP/2 200
    → (NO content-type header in the response at all)
    → body streams a valid SSE response:
       event: response.created
       data: {"type":"response.created","response":{"id":"resp_...","status":"in_progress",...}}
    

    Key point: the ChatGPT Codex backend returns HTTP 200 + a valid text/event-stream body but omits the content-type header entirely. This happens with or without Accept: text/event-stream on the request — so the fix in #90382 (adding Accept) is not sufficient; the header is simply absent on the response.

    Gateway-side

    Debug log of the failing call:

    [provider-transport-fetch] [model-fetch] start  ... url=https://chatgpt.com/backend-api/codex/responses
    [provider-transport-fetch] [model-fetch] response status=200 elapsedMs=~1200 contentType=
    [openai-transport] [responses] error ... causeCode=invalid_provider_content_type message=Connection error.
    → FailoverError: LLM request failed: network connection error.
    

    URL, auth, and store=false are all correct; the only problem is the empty content-type.

    Root cause

    assertOpenAISdkStreamContentType early-returns only for text/event-stream / JSON and otherwise throws invalid_provider_content_type — with no exemption for the native ChatGPT Codex backend, which legitimately returns an empty content-type. The native/openclaw runtime routes openai-chatgpt-responses through this SDK content-type assertion (see also #90086) instead of a codex-stream handler that tolerates the missing header.

    Minimal patch that fully unblocks it (verified)

    In assertOpenAISdkStreamContentType (provider-transport-fetch.ts), accept an empty content-type when it's the native codex backend:

    if (!params.response.ok || !params.response.body
        || isOpenAISdkStreamContentType(contentType)
        || (!contentType && usesNativeOpenAICodexResponsesBackend(params.model))) return;

    After this, openai/gpt-5.5 over ChatGPT OAuth streams and completes normally (0 transport errors). A cleaner fix would route the native codex backend to the codex stream handler per #90086, or treat a missing content-type as SSE for usesNativeOpenAICodexResponsesBackend(model).

  17. self-assigned this
    on Jun 10, 2026
  18. joshavant commented on Jun 10, 2026

    @joshavant
    Collaborator

    Closing as fixed by #90205 (ab0a633), included in v2026.6.5 and later.

    That fix addresses the reported invalid_provider_content_type failure where valid ChatGPT/Codex streamed responses were rejected when the upstream omitted content-type.

    If you still see a related failure on a newer build, please open a separate issue with your OpenClaw version, model/runtime, auth shape, command, and redacted logs.

  19. locked as resolved and limited conversation to collaborators on Jun 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P1High-priority user-facing bug, regression, or broken workflow.clawsweeper:needs-live-reproClawSweeper needs live local, crabbox, or manual validation to confirm this issue.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.impact:auth-providerAuth, provider routing, model choice, or SecretRef resolution may break.issue-rating: 🐚 platinum hermitGood issue quality with a plausible reproduction path needing some confirmation.

Type

No type

Fields

Priority

None yet

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions