openclaw - 💡(How to fix) Fix OpenRouter provider returns empty incomplete turn (stopReason=stop, payloads=0) with valid auth on 2026.4.15

Official PRs (…)
ON THIS PAGE

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

On OpenClaw 2026.4.15, OpenRouter-backed runs terminate with [agent/embedded] incomplete turn detected: stopReason=stop payloads=0 and no assistant output. Reproduces in Control UI chat, openclaw agent, and openclaw infer model run. Switching to a non-OpenRouter provider on the same install works normally, which isolates the failure to the OpenRouter adapter.

Root Cause

On OpenClaw 2026.4.15, OpenRouter-backed runs terminate with [agent/embedded] incomplete turn detected: stopReason=stop payloads=0 and no assistant output. Reproduces in Control UI chat, openclaw agent, and openclaw infer model run. Switching to a non-OpenRouter provider on the same install works normally, which isolates the failure to the OpenRouter adapter.

Fix Action

Fix / Workaround

Note attempts: [] — the provider call is never dispatched by the agent pipeline. The OpenRouter Activity dashboard confirms zero API calls reach OpenRouter during these runs.

Users who default to OpenRouter on this version cannot generate responses through the OpenClaw gateway, even with valid credentials confirmed by the built-in probe. Workaround: switch to a different provider (tested: openai-codex). Credential resolution appears correct; the break is downstream in the OpenRouter adapter itself, between auth validation and the outbound HTTP call.

Code Example

- NODE_DEBUG=https on the gateway produced zero HTTPS CLIENT lines during failing turns, confirming no outbound HTTP from the agent path.
- OPENCLAW_RAW_STREAM=1 captures only:
{"event":"assistant_message_end","rawText":"","rawThinking":""}

- No stream_start or delta events.

OpenRouter Activity dashboard: zero API calls from these runs.
Internal hooks (boot-md, bootstrap-extra-files, session-memory) enabled at default; issue persists regardless of hook state.
Prior misconfigured bare auto → openai/auto resolution was corrected per community guidance; issue persists with fully-qualified OpenRouter refs.
RAW_BUFFERClick to expand / collapse

Bug type

Behavior bug (incorrect output/state without crash)

Beta release blocker

No

Summary

On OpenClaw 2026.4.15, OpenRouter-backed runs terminate with [agent/embedded] incomplete turn detected: stopReason=stop payloads=0 and no assistant output. Reproduces in Control UI chat, openclaw agent, and openclaw infer model run. Switching to a non-OpenRouter provider on the same install works normally, which isolates the failure to the OpenRouter adapter.

Steps to reproduce

  1. Install OpenClaw 2026.4.15 via npm -g install openclaw on Ubuntu 24.04, Node 24.15 (nvm).
  2. Set a valid OPENROUTER_API_KEY in auth-profiles.json under openrouter:default (profile-based auth).
  3. Configure:

json "agents": { "defaults": { "model": { "primary": "openrouter/auto", "fallbacks": ["openrouter/openai/gpt-oss-120b:free"] } } }

  1. Restart gateway: systemctl --user restart openclaw-gateway
  2. Verify auth is healthy: openclaw models status --probe --probe-provider openrouter → returns ok.
  3. Run inference:

bash
openclaw infer model run --model openrouter/auto --prompt hi --json openclaw infer model run --model openrouter/openai/gpt-oss-120b:free --prompt hi --json

Expected behavior

A normal text response from the OpenRouter-backed model, as is produced when the same install is pointed at a non-OpenRouter provider (see Provider isolation below).

Actual behavior

Both commands emit [agent/embedded] incomplete turn detected: ... stopReason=stop payloads=0 and return:

{ "ok": true, "capability": "model.run", "transport": "local", "provider": "openrouter", "model": "openrouter/auto", "attempts": [], "outputs": [ { "text": "⚠️ Agent couldn't generate a response. Please try again.", "mediaUrl": null } ] }

Note attempts: [] — the provider call is never dispatched by the agent pipeline. The OpenRouter Activity dashboard confirms zero API calls reach OpenRouter during these runs.

OpenClaw version

2026.4.15 (041266a)

Operating system

Ubuntu 24.04

Install method

npm -g

Model

openrouter/auto (primary), openrouter/openai/gpt-oss-120b:free (fallback)

Provider / routing chain

OpenClaw Gateway → OpenRouter adapter → OpenRouter auto-router

Additional provider/model setup details

Provider isolation (key finding) Changing agents.defaults.model.primary to openai-codex/gpt-5.4 on the same install, same session, same config produces a normal response:

{ "ok": true, "provider": "openai-codex", "model": "gpt-5.4", "outputs": [ { "text": "Hey, I'm glad you're here. ...", "mediaUrl": null } ] }

Both explicit OpenRouter refs fail identically. The failure is scoped to the OpenRouter provider adapter, not the agent/hook/session layer.

Auth state (confirmed healthy)

OPENROUTER_API_KEY present in process env Same key in ~/.openclaw/agents/main/agent/auth-profiles.json under profile openrouter:default openclaw models status --probe --probe-provider openrouter returns ok:

┌────────────────────────────┬──────────────────────────────┬────────────┐ │ Model │ Profile │ Status │ ├────────────────────────────┼──────────────────────────────┼────────────┤ │ openrouter/openrouter/auto │ openrouter:default (api_key) │ ok · 41.9s │ └────────────────────────────┴──────────────────────────────┴────────────┘

Effective config Default : openrouter/openrouter/auto (from openrouter/auto) Fallbacks (1) : openrouter/openai/gpt-oss-120b:free Configured models (2): openrouter/auto, openrouter/openai/gpt-oss-120b:free No custom models.providers.openrouter block. No agents.defaults.models allowlist.

Logs, screenshots, and evidence

- NODE_DEBUG=https on the gateway produced zero HTTPS CLIENT lines during failing turns, confirming no outbound HTTP from the agent path.
- OPENCLAW_RAW_STREAM=1 captures only:
{"event":"assistant_message_end","rawText":"","rawThinking":""}

- No stream_start or delta events.

OpenRouter Activity dashboard: zero API calls from these runs.
Internal hooks (boot-md, bootstrap-extra-files, session-memory) enabled at default; issue persists regardless of hook state.
Prior misconfigured bare auto → openai/auto resolution was corrected per community guidance; issue persists with fully-qualified OpenRouter refs.

Impact and severity

Users who default to OpenRouter on this version cannot generate responses through the OpenClaw gateway, even with valid credentials confirmed by the built-in probe. Workaround: switch to a different provider (tested: openai-codex). Credential resolution appears correct; the break is downstream in the OpenRouter adapter itself, between auth validation and the outbound HTTP call.

Additional information

No response

extent analysis

TL;DR

The issue is likely caused by a problem with the OpenRouter adapter in OpenClaw 2026.4.15, and a workaround is to switch to a different provider, such as openai-codex.

Guidance

  • Verify that the OPENROUTER_API_KEY is correctly set in the auth-profiles.json file and as an environment variable.
  • Check the OpenRouter Activity dashboard to confirm that no API calls are being made from the OpenClaw gateway.
  • Try setting a different provider, such as openai-codex, to see if the issue is specific to the OpenRouter adapter.
  • Review the OpenClaw configuration to ensure that there are no custom models or providers that may be interfering with the OpenRouter adapter.

Example

No code snippet is provided as the issue appears to be related to the OpenRouter adapter and not a specific code issue.

Notes

The issue seems to be specific to the OpenRouter adapter and not related to the OpenClaw gateway or authentication. The fact that switching to a different provider resolves the issue suggests that the problem is isolated to the OpenRouter adapter.

Recommendation

Apply workaround: switch to a different provider, such as openai-codex, until the issue with the OpenRouter adapter is resolved. This is because the issue appears to be specific to the OpenRouter adapter and switching to a different provider allows users to generate responses through the OpenClaw gateway.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

A normal text response from the OpenRouter-backed model, as is produced when the same install is pointed at a non-OpenRouter provider (see Provider isolation below).

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING