openclaw - 💡(How to fix) Fix Gateway forwards empty user prompt to LLM, tripping `messages: at least one message is required` 400 and cascading cooldowns [1 comments, 2 participants]

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…
GitHub stats
openclaw/openclaw#76204Fetched 2026-05-03 04:40:50
View on GitHub
Comments
1
Participants
2
Timeline
2
Reactions
2
Timeline (top)
closed ×1commented ×1

Error Message

  • be rejected at the gateway boundary with a non-cooldown error (so the auth profile doesn't get poisoned by a malformed request the user never made).

Fix Action

Fix / Workaround

Repro / observed sequence:

  1. A session lane (in our case the claude-local Voss DM, agent:claude-local:telegram:group:-5136401288) was left in an odd state after a stuck-DM cleanup.
  2. A subsequent system/wake event for that lane produced a fresh agent run with text: "" as the user message.
  3. OpenClaw forwarded the run to Anthropic with an effectively empty messages array → Anthropic returned a messages: at least one message is required 400.
  4. The 400 was treated as a format failure on the auth profile → entered cooldown.
  5. Fallback to openai-codex/gpt-5.5 then timed out (separate latency issue), then Qwen idle-timed-out, then decision=surface_error reason=all_models_failed.
  6. Workaround: kick the gateway (clears in-memory cooldowns) and mark the dead session aborted in claude-local/sessions/sessions.json so the next user message creates a fresh session rather than appending to empty-content history.
RAW_BUFFERClick to expand / collapse

Version: 2026.4.27 (issue observed; persistence in 2026.4.29 not directly verified — worth confirming)

Repro / observed sequence:

  1. A session lane (in our case the claude-local Voss DM, agent:claude-local:telegram:group:-5136401288) was left in an odd state after a stuck-DM cleanup.
  2. A subsequent system/wake event for that lane produced a fresh agent run with text: "" as the user message.
  3. OpenClaw forwarded the run to Anthropic with an effectively empty messages array → Anthropic returned a messages: at least one message is required 400.
  4. The 400 was treated as a format failure on the auth profile → entered cooldown.
  5. Fallback to openai-codex/gpt-5.5 then timed out (separate latency issue), then Qwen idle-timed-out, then decision=surface_error reason=all_models_failed.
  6. Workaround: kick the gateway (clears in-memory cooldowns) and mark the dead session aborted in claude-local/sessions/sessions.json so the next user message creates a fresh session rather than appending to empty-content history.

Suggested fix: validate the outgoing messages array (and individual content blocks) before submission. Empty content should either:

  • be dropped silently (preferred for system/wake events), or
  • be rejected at the gateway boundary with a non-cooldown error (so the auth profile doesn't get poisoned by a malformed request the user never made).

Why it matters: any future occurrence cascades the entire provider stack into cooldown, surfaces all_models_failed to the user, and requires a manual gateway restart. This is exactly the failure pattern the cooldown system is meant to prevent for legitimate provider failures, but it triggers on a request the user never made.

Logs / artifacts available (can attach if useful):

  • ~/.openclaw/logs/gateway.err.log 2026-04-30 ~13:15 PT
  • claude-local/sessions/sessions.json.bak.<ts>

extent analysis

TL;DR

Validate the outgoing messages array to prevent empty content submissions that cause cascading failures.

Guidance

  • Verify the issue by checking the gateway.err.log for cooldown entries and sessions.json for empty session histories.
  • Implement a check for empty messages arrays before submitting to Anthropic, and either drop them silently or reject with a non-cooldown error.
  • Consider adding logging for rejected empty messages to track occurrences and potential issues.
  • Review the cooldown mechanism to ensure it's not triggered by malformed requests that the user never made.

Example

No code snippet is provided as the issue does not contain sufficient code context.

Notes

The suggested fix is based on the provided issue description and may require additional implementation details. The logs and artifacts mentioned can help verify the issue and identify potential problems.

Recommendation

Apply the workaround of validating the outgoing messages array to prevent empty content submissions, as this addresses the root cause of the cascading failures.

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 Gateway forwards empty user prompt to LLM, tripping `messages: at least one message is required` 400 and cascading cooldowns [1 comments, 2 participants]