openclaw - 💡(How to fix) Fix [Bug] /reset and /new trigger empty-message LLM call → 400 error surfaced to user [1 participants]

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…
GitHub stats
openclaw/openclaw#74537Fetched 2026-04-30 06:23:21
View on GitHub
Comments
0
Participants
1
Timeline
0
Reactions
2

When /reset or /new is triggered on a session that lossless-claw considers "already fresh" (no conversation history), OpenClaw fires a session-end lifecycle LLM call with an empty message array. Anthropic rejects this with 400: messages: at least one message is required. The fallback model is put into cooldown and the error surfaces to the user as:

⚠️ Something went wrong while processing your request. Please try again, or use /new to start a fresh session.

The reset itself succeeds — only the goodbye/wrap-up LLM call fails.

Error Message

When /reset or /new is triggered on a session that lossless-claw considers "already fresh" (no conversation history), OpenClaw fires a session-end lifecycle LLM call with an empty message array. Anthropic rejects this with 400: messages: at least one message is required. The fallback model is put into cooldown and the error surfaces to the user as: 3. Observe error message in Telegram If the session has no messages (already fresh), the session-end LLM call should be skipped. No error should be surfaced to the user. User sees error message. Session is actually clean and works fine on next interaction. "error": "LLM request rejected: messages: at least one message is required", "rawErrorPreview": "400 {"type":"error","error":{"type":"invalid_request_error","message":"messages: at least one message is required"}}",

Root Cause

When /reset or /new is triggered on a session that lossless-claw considers "already fresh" (no conversation history), OpenClaw fires a session-end lifecycle LLM call with an empty message array. Anthropic rejects this with 400: messages: at least one message is required. The fallback model is put into cooldown and the error surfaces to the user as:

⚠️ Something went wrong while processing your request. Please try again, or use /new to start a fresh session.

The reset itself succeeds — only the goodbye/wrap-up LLM call fails.

Code Example

[lcm] session_end:reset lifecycle no-op for already fresh conversation 2
[lcm] /reset lifecycle no-op for already fresh conversation 2

---

{
  "event": "embedded_run_agent_end",
  "isError": true,
  "error": "LLM request rejected: messages: at least one message is required",
  "failoverReason": "format",
  "model": "claude-sonnet-4-6",
  "provider": "anthropic",
  "rawErrorPreview": "400 {\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"messages: at least one message is required\"}}",
  "httpCode": "400",
  "providerErrorType": "invalid_request_error"
}

---

{
  "event": "auth_profile_failure_state_updated",
  "reason": "format",
  "windowType": "cooldown",
  "failureCounts": {"format": 1}
}
RAW_BUFFERClick to expand / collapse

Summary

When /reset or /new is triggered on a session that lossless-claw considers "already fresh" (no conversation history), OpenClaw fires a session-end lifecycle LLM call with an empty message array. Anthropic rejects this with 400: messages: at least one message is required. The fallback model is put into cooldown and the error surfaces to the user as:

⚠️ Something went wrong while processing your request. Please try again, or use /new to start a fresh session.

The reset itself succeeds — only the goodbye/wrap-up LLM call fails.

Steps to Reproduce

  1. Start a fresh session (or reset once already)
  2. Immediately trigger /reset or /new again
  3. Observe error message in Telegram

Expected Behavior

If the session has no messages (already fresh), the session-end LLM call should be skipped. No error should be surfaced to the user.

Actual Behavior

User sees error message. Session is actually clean and works fine on next interaction.

Log Evidence

lossless-claw logs the no-op correctly:

[lcm] session_end:reset lifecycle no-op for already fresh conversation 2
[lcm] /reset lifecycle no-op for already fresh conversation 2

But OpenClaw still fires the LLM call:

{
  "event": "embedded_run_agent_end",
  "isError": true,
  "error": "LLM request rejected: messages: at least one message is required",
  "failoverReason": "format",
  "model": "claude-sonnet-4-6",
  "provider": "anthropic",
  "rawErrorPreview": "400 {\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"messages: at least one message is required\"}}",
  "httpCode": "400",
  "providerErrorType": "invalid_request_error"
}

Auth profile then enters cooldown:

{
  "event": "auth_profile_failure_state_updated",
  "reason": "format",
  "windowType": "cooldown",
  "failureCounts": {"format": 1}
}

Environment

  • OpenClaw version: runtime node=v25.8.2
  • OS: macOS Darwin 25.4.0 (arm64)
  • Channel: Telegram (direct message)
  • Plugin: lossless-claw active
  • Model: anthropic/claude-sonnet-4-6

Suggested Fix

Before firing the session-end LLM call on /reset or /new, check if the message history is empty. If so, skip the call entirely. lossless-claw already detects and logs this condition — the runtime should respect it and not proceed with an LLM call that will always fail.

extent analysis

TL;DR

Check for empty message history before firing the session-end LLM call on /reset or /new to prevent unnecessary requests that will be rejected.

Guidance

  • Review the logic in OpenClaw that handles the session-end LLM call to ensure it respects the "already fresh" condition detected by lossless-claw.
  • Modify the code to skip the LLM call when the message history is empty, as suggested in the issue.
  • Verify that the session_end lifecycle no-op logging in lossless-claw is correctly indicating when a session is already fresh and the LLM call should be skipped.
  • Test the updated logic with the steps to reproduce provided in the issue to ensure the error is no longer surfaced to the user.

Example

No code snippet is provided as the issue does not include specific code references, but the fix involves checking the message history before making the LLM call, potentially using a condition like if (messageHistory.isEmpty()) { skipLLMCall(); }.

Notes

The issue seems to be specific to the interaction between OpenClaw, lossless-claw, and the Anthropic model. The suggested fix should be applied with consideration of the overall system's behavior and potential side effects on other functionalities.

Recommendation

Apply the workaround by modifying the OpenClaw logic to skip the session-end LLM call when the message history is empty, as this directly addresses the root cause of the error and prevents unnecessary requests to the Anthropic model.

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 [Bug] /reset and /new trigger empty-message LLM call → 400 error surfaced to user [1 participants]