openclaw - 💡(How to fix) Fix Agent runtime returns empty response for anthropic/claude-opus-4-7 while infer model run works (macOS 26.2, Node 26)

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

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…

openclaw agent and the embedded agent runtime invoked through the gateway/Control UI consistently fails with FailoverError: anthropic/claude-opus-4-7 ended with an incomplete terminal response (payloads=0 stopReason=stop), but openclaw infer model run --model anthropic/claude-opus-4-7 --prompt "hi" against the same key on the same machine returns a normal text reply. Direct curl to api.anthropic.com/v1/messages also works. This means the agent runtime is calling Anthropic in a way that produces zero visible payloads, but the lower-level inference path is fine.

Error Message

Works

openclaw infer model run --model anthropic/claude-opus-4-7 --prompt "say hi"

→ "Hi there, friend!"

Fails

openclaw agent --agent main --message "say hi"

→ FailoverError: anthropic/claude-opus-4-7 ended with an incomplete terminal response

Root Cause

Setting agents.defaults.thinking=off did not appear to clear the issue (possibly because it didn't actually disable the field for claude-opus-4-7 in the request).

Code Example

# Works
openclaw infer model run --model anthropic/claude-opus-4-7 --prompt "say hi"
# → "Hi there, friend!"

# Fails
openclaw agent --agent main --message "say hi"
# → FailoverError: anthropic/claude-opus-4-7 ended with an incomplete terminal response

---

[agent/embedded] empty response detected: runId=… sessionId=… provider=anthropic/claude-opus-4-7 — retrying 1/1 with visible-answer continuation
[agent/embedded] empty response retries exhausted: … attempts=1/1 — surfacing incomplete-turn error
[agent/embedded] incomplete turn detected: … stopReason=stop payloads=0 — surfacing error to user
[model-fallback/decision] model fallback decision: decision=candidate_failed requested=anthropic/claude-opus-4-7 candidate=anthropic/claude-opus-4-7 reason=format next=none detail=anthropic/claude-opus-4-7 ended with an incomplete terminal response

---

{
  "type": "error",
  "error": {
    "type": "invalid_request_error",
    "message": "\"thinking.type.enabled\" is not supported for this model. Use \"thinking.type.adaptive\" and \"output_config.effort\" to control thinking behavior."
  }
}
RAW_BUFFERClick to expand / collapse

Agent runtime returns empty response for anthropic/claude-opus-4-7 while infer model run works (macOS 26.2, Node 26)

Summary

openclaw agent and the embedded agent runtime invoked through the gateway/Control UI consistently fails with FailoverError: anthropic/claude-opus-4-7 ended with an incomplete terminal response (payloads=0 stopReason=stop), but openclaw infer model run --model anthropic/claude-opus-4-7 --prompt "hi" against the same key on the same machine returns a normal text reply. Direct curl to api.anthropic.com/v1/messages also works. This means the agent runtime is calling Anthropic in a way that produces zero visible payloads, but the lower-level inference path is fine.

Environment

  • macOS 26.2 (build 25C56), arm64, Apple Silicon (Mac mini)
  • Node v26.0.0 via Homebrew formula node
  • OpenClaw 2026.5.7 (commit eeef486)
  • Installed via npm i -g openclaw
  • Anthropic API key valid (verified via curl and infer model run)
  • No proxy, no VPN, no MDM
  • Issue persists on a totally fresh state directory (mv ~/.openclaw …; openclaw onboard --non-interactive --accept-risk) with only auth-profiles.json copied over from the working host.

Reproduction

# Works
openclaw infer model run --model anthropic/claude-opus-4-7 --prompt "say hi"
# → "Hi there, friend!"

# Fails
openclaw agent --agent main --message "say hi"
# → FailoverError: anthropic/claude-opus-4-7 ended with an incomplete terminal response

Same key, same machine, same OpenClaw binary.

Logs (key lines)

[agent/embedded] empty response detected: runId=… sessionId=… provider=anthropic/claude-opus-4-7 — retrying 1/1 with visible-answer continuation
[agent/embedded] empty response retries exhausted: … attempts=1/1 — surfacing incomplete-turn error
[agent/embedded] incomplete turn detected: … stopReason=stop payloads=0 — surfacing error to user
[model-fallback/decision] model fallback decision: decision=candidate_failed requested=anthropic/claude-opus-4-7 candidate=anthropic/claude-opus-4-7 reason=format next=none detail=anthropic/claude-opus-4-7 ended with an incomplete terminal response

agent model: anthropic/claude-opus-4-7 (thinking=medium, fast=off) is logged on gateway start.

Suspected cause (worth investigating)

Anthropic recently rejected the thinking.type=enabled request shape for claude-opus-4-7, returning:

{
  "type": "error",
  "error": {
    "type": "invalid_request_error",
    "message": "\"thinking.type.enabled\" is not supported for this model. Use \"thinking.type.adaptive\" and \"output_config.effort\" to control thinking behavior."
  }
}

If OpenClaw's agent layer sends thinking.type=enabled (vs. the new adaptive form) when thinking=medium, the API call would either error 400 (visible) or — if OpenClaw is silently swallowing the error — produce zero payloads, which is exactly what we see. infer model run may not include the thinking block at all, which would explain why it works.

Setting agents.defaults.thinking=off did not appear to clear the issue (possibly because it didn't actually disable the field for claude-opus-4-7 in the request).

Things ruled out

  • Migrated state corruption (fresh state shows the same failure)
  • Session JSONL corruption (fresh session ID, same failure)
  • Node version (tested on 22.22.2 and 26.0.0)
  • API key (works via curl and infer model run)
  • Network/TLS (no proxies, no MDM, plain HTTP/2 reaches Anthropic fine)

Files

Available from local hosts:

  • ~/.openclaw/logs/gateway.err.log
  • /tmp/openclaw/openclaw-2026-05-08.log

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…

Still need to ship something?

×6

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

Back to top recommendations

TRENDING

openclaw - 💡(How to fix) Fix Agent runtime returns empty response for anthropic/claude-opus-4-7 while infer model run works (macOS 26.2, Node 26)