#openai/gpt-5.4-mini failed

1 messages · Page 1 of 1 (latest)

floral kettle
scenic grottoBOT
#

To help others find answers, you can mark your question as solved via Right click solution message -> Apps -> ✅ Mark Solution

wooden robinBOT
# floral kettle error Embedded agent failed before reply: stream disconnected before completion:...

First thing: please paste your version:

openclaw --version

That error is happening before the model can reply: OpenClaw is trying to call OpenAI's Responses endpoint and the HTTP stream disconnects while sending the request. So I’d check connectivity/auth/logs before changing model config.

Please run:

openclaw status --all
openclaw gateway status
openclaw logs --follow

In the logs, look for the line immediately above/below https://api.openai.com/v1/responses. The useful clues are usually things like DNS failure, timeout, TLS/cert issue, proxy/VPN/firewall, 401 auth, or a 429/rate-limit.

wooden robinBOT
floral kettle
#

openclaw --version
OpenClaw 2026.5.12 (f066dd2)

openclaw gateway status
🦞 OpenClaw 2026.5.12 (f066dd2) — Pairing codes exist because even bots believe in consent—and good security hygiene.



Service: systemd user (enabled)
File logs: /tmp/openclaw/openclaw-2026-05-17.log
Command: /home/linuxbrew/.linuxbrew/opt/node/bin/node /home/linuxbrew/.linuxbrew/lib/node_modules/openclaw/dist/index.js gateway --port 18789
Service file: ~/.config/systemd/user/openclaw-gateway.service
Service env: OPENCLAW_GATEWAY_PORT=18789

Config (cli): ~/.openclaw/openclaw.json
Config (service): ~/.openclaw/openclaw.json

Gateway: bind=loopback (127.0.0.1), port=18789 (service args)
Probe target: ws://127.0.0.1:18789
Dashboard: http://127.0.0.1:18789/
Probe note: Loopback-only gateway; only local clients can connect.

CLI version: 2026.5.12 (/home/linuxbrew/.linuxbrew/bin/openclaw)
Gateway version: 2026.5.12

Runtime: running (pid 410001, state active, sub running, last exit 0, reason 0)
Connectivity probe: ok
Capability: admin-capable

Listening: 127.0.0.1:18789
Troubles: run openclaw status
Troubleshooting: https://docs.openclaw.ai/troubleshooting

#

openclaw logs
10:39:18+00:00 warn agent/embedded {"subsystem":"agent/embedded"} {"event":"embedded_run_failover_decision","tags":["error_handling","failover","prompt","surface_error"],"runId":"1988c1ed-e9fa-4a10-9e44-044b10c58272","stage":"prompt","decision":"surface_error","failoverReason":null,"profileFailureReason":null,"provider":"openai","model":"gpt-5.4-mini","sourceProvider":"openai","sourceModel":"gpt-5.4-mini","profileId":"sha256:a0ebe3f799a6","fallbackConfigured":false,"aborted":false,"rawErrorPreview":"stream disconnected before completion: error sending request for url (https://api.openai.com/v1/responses)","rawErrorHash":"sha256:6aa08e2e3c38","providerRuntimeFailureKind":"unclassified"} embedded run failover decision
10:39:18+00:00 error diagnostic {"subsystem":"diagnostic"} lane task error: lane=main durationMs=187366 error="stream disconnected before completion: error sending request for url (https://api.openai.com/v1/responses)"
10:39:18+00:00 error diagnostic {"subsystem":"diagnostic"} lane task error: lane=session:agent:main:discord:direct:1490627767384150106 durationMs=187368 error="stream disconnected before completion: error sending request for url (https://api.openai.com/v1/responses)"
10:39:18+00:00 error Embedded agent failed before reply: stream disconnected before completion: error sending request for url (https://api.openai.com/v1/responses)

wooden robinBOT
# floral kettle openclaw --version OpenClaw 2026.5.12 (f066dd2) openclaw gateway status 🦞 Open...

Thanks, this is useful. Gateway + Discord look healthy, and CLI/Gateway versions match.

Two things stand out:

  1. You’re running Node 25.6.1. OpenClaw docs say Node 24 is the recommended runtime, with Node 22.16+ supported. I would switch the service to Node 24 when you can, then reinstall/restart the gateway service. Node 25 is newer than the recommended path and can cause weird runtime/HTTP behavior.

Docs: https://docs.openclaw.ai/install/node

  1. The error still looks like the OpenAI request is failing at the network/auth/request layer, not Discord. Please grab the exact log lines around the failure:
openclaw logs --follow

Then trigger one failed reply and paste the few lines around api.openai.com/v1/responses / cause: / status:.

Also run these two checks:

wooden robinBOT
# floral kettle openclaw --version OpenClaw 2026.5.12 (f066dd2) openclaw gateway status 🦞 Open...
curl -I https://api.openai.com/v1/responses
openclaw models status

For the curl result: 401 or 404 is okay as a network test. Timeout/DNS/TLS/connect reset points to network/proxy/firewall. openclaw models status will show whether the OpenAI auth/profile is actually usable without exposing the key.

Minor separate note: status shows one agent, investment, is still bootstrapping because it has a bootstrap file present. If this Discord thread is bound to that agent, that can cause unrelated weirdness; otherwise it’s probably not the cause here.

wooden robinBOT
# floral kettle openclaw logs 10:39:18+00:00 warn agent/embedded {"subsystem":"agent/embedded"} ...

Yep, that log narrows it down: the run waited about 187 seconds, then the OpenAI Responses stream disconnected. There’s no visible HTTP status in that snippet, so OpenClaw can’t classify it as auth/rate-limit/etc.

Next checks:

curl -v https://api.openai.com/v1/responses
openclaw models status

For curl -v, please paste only the final connection/status lines, not any secrets. A 401 from OpenAI is fine here; it proves network/TLS can reach the API. Timeout, reset, DNS, or TLS errors point to the machine/network path.

Because the gateway is running under Node 25.6.1, I’d also switch to Node 24 and restart the service. Docs say Node 24 is the recommended runtime:
https://docs.openclaw.ai/install/node

One more practical mitigation: you have no fallback configured:

wooden robinBOT
floral kettle
#

{
"error": {
"message": "Missing bearer or basic authentication in header",
"type": "invalid_request_error",
"param": null,
"code": null
}

wooden robinBOT
# floral kettle { "error": { "message": "Missing bearer or basic authentication in header"...

Good, that response means the host can reach OpenAI. The missing auth message is expected for a raw curl without an Authorization header, so network/TLS is probably not the blocker.

Now check OpenClaw’s auth/profile state:

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

The log shows OpenClaw used provider openai, model gpt-5.4-mini, profile sha256:a0ebe3f799a6. If models status says that profile/provider is unhealthy or missing, re-run the relevant auth flow:

For ChatGPT/Codex subscription auth:

openclaw models auth login --provider openai-codex --device-code
openclaw config set agents.defaults.model.primary openai/gpt-5.4-mini
wooden robinBOT
floral kettle
#

🦞 OpenClaw 2026.5.12 (f066dd2) — I read logs so you can keep pretending you don't have to.

Config : ~/.openclaw/openclaw.json
Agent dir : ~/.openclaw/agents/main/agent
Default : openai/gpt-5.4-mini
Fallbacks (0) : -
Image model : -
Image fallbacks (0): -
Aliases (11) : Claude Opus 4.6 -> anthropic/claude-opus-4-6, Claude Sonnet 4.6 -> anthropic/claude-sonnet-4-6, Claude Haiku 4.5 -> anthropic/claude-haiku-4-5, GPT-5.5 -> openai/gpt-5.5, GPT-5.4 -> openai/gpt-5.4, GPT-5.4 mini -> openai/gpt-5.4-mini, Gemini 3.1 Pro Preview -> google/gemini-3.1-pro-preview, Gemini 3 Flash Preview -> google/gemini-3-flash-preview, Gemini 3.1 Flash Lite -> google/gemini-3.1-flash-lite-preview, Gemma 4 E4B -> ollama/gemma4:e4b, Gemma 4 26B A4B MoE -> cloudflare-ai-gateway/workers-ai/@cf/google/gemma-4-26b-a4b-it
Configured models (11): anthropic/claude-opus-4-6, anthropic/claude-sonnet-4-6, anthropic/claude-haiku-4-5, openai/gpt-5.5, openai/gpt-5.4, openai/gpt-5.4-mini, google/gemini-3.1-pro-preview, google/gemini-3-flash-preview, google/gemini-3.1-flash-lite-preview, ollama/gemma4:e4b, cloudflare-ai-gateway/workers-ai/@cf/google/gemma-4-26b-a4b-it

Auth overview
Auth store : ~/.openclaw/agents/main/agent/auth-profiles.json
Shell env : off
Providers w/ OAuth/tokens (0): -

  • cloudflare-ai-gateway effective=env:cfut_qrk...382d042a | env=cfut_qrk...382d042a | source=env: CLOUDFLARE_AI_GATEWAY_API_KEY
  • google effective=env:AIzaSyAC...ruwlluvM | env=AIzaSyAC...ruwlluvM | source=env: GEMINI_API_KEY | models.json=[[GEMINI...PI_KEY]] | source=models.json: ~/.openclaw/agents/main/agent/models.json
  • ollama effective=models.json:marker(ollama-local) | models.json=marker(ollama-local) | source=models.json: ~/.openclaw/agents/main/agent/models.json | synthetic=plugin-owned | source=models.providers.ollama (synthetic local key)
#
  • openai effective=profiles:~/.openclaw/agents/main/agent/auth-profiles.json | profiles=1 (oauth=0, token=0, api_key=1) | openai:default=sk-proj-...WG-OBH0A | env=sk-proj-...WG-OBH0A | source=env: OPENAI_API_KEY
  • xai effective=env:xai-SngO...V9Nb5nXG | env=xai-SngO...V9Nb5nXG | source=env: XAI_API_KEY | synthetic=plugin-owned | source=xAI plugin config

OAuth/token status

  • none
wooden robinBOT
# floral kettle 🦞 OpenClaw 2026.5.12 (f066dd2) — I read logs so you can keep pretending you don...

This explains it: your default model is OpenAI, but models status shows no usable OpenAI auth at all.

Key lines:

Default: openai/gpt-5.4-mini
Providers w/ OAuth/tokens (0): -

and the auth overview only shows Cloudflare, Google, and Ollama. So the agent is trying OpenAI, then failing because there’s no OpenAI/Codex credential available to the gateway service.

Pick one fix:

For ChatGPT/Codex subscription auth:

openclaw models auth login --provider openai-codex --device-code
wooden robinBOT
wooden robinBOT
# floral kettle - openai effective=profiles:~/.openclaw/agents/main/agent/auth-profiles.json | p...

Ah, that second snippet changes the diagnosis. You do have OpenAI API-key auth:

openai effective=profiles...
profiles=1 (... api_key=1)
source=env: OPENAI_API_KEY

So ignore my previous “no OpenAI auth” read; your first paste was just missing the OpenAI lines. This now looks like either the key/project can’t successfully run that model, the Responses request is timing out mid-stream, or Node 25 is involved.

Please run the smallest OpenClaw smoke test:

openclaw infer model run --model openai/gpt-5.4-mini --prompt "Reply with exactly: smoke-ok" --json

If that fails, paste the error. That removes Discord/session history/tools from the equation.

wooden robinBOT
floral kettle
#

Error: No text output returned for provider "openai" model "gpt-5.4-mini": Failed to extract accountId from token.

wooden robinBOT
# floral kettle Error: No text output returned for provider "openai" model "gpt-5.4-mini": Faile...

That error is the real cause.

Failed to extract accountId from token

You’re using an OpenAI Platform API key (sk-proj-...), but openai/gpt-5.4-mini agent turns default to the Codex app-server runtime. That runtime is account/Codex-profile based and is trying to read a Codex account id from a token that is actually a normal API key.

Best fixes:

Option A: use Codex/ChatGPT auth for the default OpenAI agent route

openclaw models auth login --provider openai-codex --device-code
openclaw gateway restart
openclaw infer model run --model openai/gpt-5.4-mini --prompt "Reply with exactly: smoke-ok" --json
wooden robinBOT
# floral kettle Error: No text output returned for provider "openai" model "gpt-5.4-mini": Faile...

Option B: keep using the OpenAI API key, but force the OpenAI model through PI instead of Codex runtime
Check current runtime config first:

openclaw config get models.providers.openai.agentRuntime --json
openclaw config get agents.defaults.models --json

Then set a model-scoped runtime override for that model:

openclaw config set agents.defaults.models '{"openai/gpt-5.4-mini":{"agentRuntime":{"id":"pi"}}}' --strict-json --merge
openclaw gateway restart
openclaw infer model run --model openai/gpt-5.4-mini --prompt "Reply with exactly: smoke-ok" --json

Docs for why: openai/* agent turns use Codex by default; direct API-key agent billing needs either a Codex-compatible API-key profile or explicit PI runtime.

floral kettle
#

11:06:04+00:00 warn agent/embedded {"subsystem":"agent/embedded"} {"event":"embedded_run_failover_decision","tags":["error_handling","failover","prompt","surface_error"],"runId":"e1929c76-b5f5-48c5-b1f7-9b9c21544320","stage":"prompt","decision":"surface_error","failoverReason":null,"profileFailureReason":null,"provider":"openai","model":"gpt-5.4-mini","sourceProvider":"openai","sourceModel":"gpt-5.4-mini","profileId":"sha256:a0ebe3f799a6","fallbackConfigured":false,"aborted":false,"rawErrorPreview":"stream disconnected before completion: error sending request for url (https://api.openai.com/v1/responses)","rawErrorHash":"sha256:6aa08e2e3c38","providerRuntimeFailureKind":"unclassified"} embedded run failover decision
11:06:04+00:00 error diagnostic {"subsystem":"diagnostic"} lane task error: lane=main durationMs=185486 error="stream disconnected before completion: error sending request for url (https://api.openai.com/v1/responses)"
11:06:04+00:00 error diagnostic {"subsystem":"diagnostic"} lane task error: lane=session:agent:main:discord:direct:1490627767384150106 durationMs=185488 error="stream disconnected before completion: error sending request for url (https://api.openai.com/v1/responses)"
11:06:04+00:00 error Embedded agent failed before reply: stream disconnected before completion: error sending request for url (https://api.openai.com/v1/responses)
11:06:05+00:00 info gateway/skills-remote {"subsystem":"gateway/skills-remote"} remote bin probe skipped: node unavailable (f4b1c4e1c2eca3339b0455d3a294b98442796c77c419e6d46e5b51f51e363549; command=system.which timeoutMs=15000 requiredBins=44 connected=no)

wooden robinBOT
# floral kettle 11:06:04+00:00 warn agent/embedded {"subsystem":"agent/embedded"} {"event":"embe...

That log is back to the original Responses stream disconnect. The remote bin probe skipped: node unavailable line is probably separate; it means a remote node/skills probe was unavailable, not the OpenAI request itself.

What matters is this still says:

provider="openai"
model="gpt-5.4-mini"
profileId="sha256:a0ebe3f799a6"
fallbackConfigured=false
https://api.openai.com/v1/responses

So please verify which route is active after the change:

openclaw config get agents.defaults.models --json
wooden robinBOT
# floral kettle 11:06:04+00:00 warn agent/embedded {"subsystem":"agent/embedded"} {"event":"embe...
openclaw config get models.providers.openai.agentRuntime --json
openclaw infer model run --model openai/gpt-5.4-mini --prompt "Reply with exactly: smoke-ok" --json

If you chose the API-key/PI route, the first command should show openai/gpt-5.4-mini with "agentRuntime":{"id":"pi"}. If it does not, the model is still being handled by the default OpenAI/Codex route.

Also run this once:

openclaw models status --json

Check auth.unusableProfiles for that sha256:a0ebe3... profile. If the smoke test now fails with the same stream disconnect even under PI, then this is no longer the Codex account-id issue; it’s likely the OpenAI API request itself timing out/resetting for that key/project/model, or Node 25. At that point I’d switch the service to Node 24 and retry the smoke test before chasing Discord/session state.

floral kettle
#

openclaw infer model run --model openai/gpt-5.4-mini --prompt "Reply with exactly: smoke-ok" --json
{
"ok": true,
"capability": "model.run",
"transport": "local",
"provider": "openai",
"model": "gpt-5.4-mini",
"attempts": [],
"outputs": [
{
"text": "smoke-ok",
"mediaUrl": null
}
]
}

wooden robinBOT
# floral kettle openclaw infer model run --model openai/gpt-5.4-mini --prompt "Reply with exactl...

Great, that’s a clean pass. So OpenAI auth + the basic gpt-5.4-mini call are working now.

That means the remaining failure is specific to the Discord/session agent path: likely the current session transcript/tool context is large or stuck, or the channel run is still using older session/runtime state.

Try this in the Discord thread/DM where it fails:

/status
/reset

Then send a tiny test message. If it still fails, try starting a fresh model session explicitly:

/new openai/gpt-5.4-mini
wooden robinBOT
# floral kettle openclaw infer model run --model openai/gpt-5.4-mini --prompt "Reply with exactl...

Docs for these commands: https://docs.openclaw.ai/tools/slash-commands

If a fresh session works, the old session was the problem. If a fresh session still fails while openclaw infer model run keeps passing, grab the next log after /reset or /new; then it’s probably a Discord embedded-agent/session-runtime bug worth filing with the smoke-test output and logs:
https://github.com/openclaw/openclaw/issues

Also: since the failing run waits ~185s, Node 25 is still worth fixing separately, but it’s no longer the first thing I’d chase now that the model smoke test passes.

floral kettle
wooden robinBOT
# floral kettle fuck

Oof. The screenshot actually shows progress though:

  • smoke-ok works inside Discord now
  • /status shows Runtime: OpenClaw Pi Default
  • OpenAI API-key auth is active: api-key (openai:default)
  • context is only 82k/400k

So the original OpenAI/Codex auth-routing problem looks fixed. This new failure is probably the specific long cron-editing task blowing up during tools/session execution, not basic model/auth.

Please grab the log lines for the 20:22 failure:

openclaw logs --follow

Then rerun just that task once and paste the error lines around Something went wrong.

wooden robinBOT
# floral kettle fuck

I’d also try it in a clean session because the task is big and tool-heavy:

/new openai/gpt-5.4-mini
昨日の配信チェックのcronを修正して。まず現在のcron定義と関連スクリプトを調べて、変更前に短い実装方針を出して。

That splits off the investigation step first. If that works, then ask it to implement after it shows the plan. If the investigation step also fails, the logs should show whether it’s cron permissions, exec/tool failure, or another model request disconnect.

floral kettle
#

logs:
11:35:02+00:00 warn openai-transport {"subsystem":"openai-transport"} [responses] error provider=openai api=openai-responses model=gpt-5.4-mini name=Error status=undefined code=rate_limit_exceeded type=tokens causeName=undefined causeCode=undefined message=Rate limit reached for gpt-5.4-mini in organization org-WBvkYTKcqHjeM5nLhh7MHTbk on tokens per min (TPM): Limit 200000, Used 150133, Requested 110738. Please try again in 18.261s. Visit https://platform.openai.com/account/rate-limits to learn more.
11:35:02+00:00 warn agent/embedded {"subsystem":"agent/embedded"} {"event":"embedded_run_agent_end","tags":["error_handling","lifecycle","agent_end","assistant_error"],"runId":"5482878a-d875-4a82-aec1-340839797686","isError":true,"error":"⚠️ Rate limit reached for gpt-5.4-mini in organization org-WBvkYTKcqHjeM5nLhh7MHTbk on tokens per min (TPM): Limit 200000, Used 150133, Requested 110738. Please try again in 18.261s. Visit https://platform.openai.com/account/rate-limits to learn more.","failoverReason":"rate_limit","model":"gpt-5.4-mini","provider":"openai","rawErrorPreview":"Rate limit reached for gpt-5.4-mini in organization org-WBvkYTKcqHjeM5nLhh7MHTbk on tokens per min (TPM): Limit 200000, Used 150133, Requested 110738. Please try again in 18.261s. Visit https://platform.openai.com/account/rate-limits to learn more.","rawErrorHash":"sha256:2bd8705b153e","providerRuntimeFailureKind":"rate_limit"} embedded run agent end

wooden robinBOT