openclaw - 💡(How to fix) Fix `/new` command fails with empty messages error on QQ Bot channel [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#74721Fetched 2026-04-30 06:20:48
View on GitHub
Comments
1
Participants
2
Timeline
3
Reactions
2
Author
Timeline (top)
closed ×1commented ×1cross-referenced ×1

Error Message

error="FailoverError: LLM request rejected: 'messages' must contain at least one entry for Claude /messages requests" providerErrorType: "invalid_request_error" httpCode: "400" providerRuntimeFailureKind: "schema"

Root Cause

From gateway logs, the error is:

LLM request rejected: 'messages' must contain at least one entry for Claude /messages requests

When /new resets the session, the framework attempts to call the LLM (xiaomi-coding/mimo-v2.5-pro, Claude-compatible API) with an empty messages array. The API rejects this with a 400 error.

The relevant log entry:

error="FailoverError: LLM request rejected: 'messages' must contain at least one entry for Claude /messages requests"
providerErrorType: "invalid_request_error"
httpCode: "400"
providerRuntimeFailureKind: "schema"

Code Example

LLM request rejected: 'messages' must contain at least one entry for Claude /messages requests

---

error="FailoverError: LLM request rejected: 'messages' must contain at least one entry for Claude /messages requests"
providerErrorType: "invalid_request_error"
httpCode: "400"
providerRuntimeFailureKind: "schema"
RAW_BUFFERClick to expand / collapse

Bug Description

Sending /new command in QQ Bot (C2C private chat) results in an error: "⚠️ Something went wrong while processing your request. Please try again, or use /new to start a fresh session." — which is a circular reference since /new itself caused the error.

Root Cause

From gateway logs, the error is:

LLM request rejected: 'messages' must contain at least one entry for Claude /messages requests

When /new resets the session, the framework attempts to call the LLM (xiaomi-coding/mimo-v2.5-pro, Claude-compatible API) with an empty messages array. The API rejects this with a 400 error.

The relevant log entry:

error="FailoverError: LLM request rejected: 'messages' must contain at least one entry for Claude /messages requests"
providerErrorType: "invalid_request_error"
httpCode: "400"
providerRuntimeFailureKind: "schema"

Steps to Reproduce

  1. Configure OpenClaw with QQ Bot channel and a Claude-compatible provider (e.g., xiaomi-coding/mimo-v2.5-pro)
  2. Send /new in QQ Bot C2C private chat
  3. Error is returned instead of session reset confirmation

Suggested Fix

In pi-embedded-aAN5CWPb.js (runEmbeddedPiAgent), after loading session messages, check if the messages array is empty before making the LLM call. If empty, return a deterministic response (e.g., "✅ New session started") instead of calling the LLM with an empty messages array.

Alternatively, the /new command handler in commands.runtime-BBQOlJl9.js could return a fixed reply text instead of routing through the agent run loop when the session is being freshly created.

Environment

  • OpenClaw version: 2026.4.26
  • Channel: QQ Bot (C2C)
  • Provider: xiaomi-coding/mimo-v2.5-pro (Claude-compatible API)

extent analysis

TL;DR

Modify the runEmbeddedPiAgent function in pi-embedded-aAN5CWPb.js to check for an empty messages array before making the LLM call and return a deterministic response instead.

Guidance

  • Check the messages array for emptiness before calling the LLM API to prevent 400 errors.
  • Consider modifying the /new command handler in commands.runtime-BBQOlJl9.js to return a fixed reply text when creating a new session.
  • Verify the fix by sending the /new command in QQ Bot C2C private chat and checking for the expected response.
  • Ensure that the deterministic response returned when the messages array is empty does not cause any downstream issues.

Example

// In pi-embedded-aAN5CWPb.js
function runEmbeddedPiAgent() {
  // ...
  if (messages.length === 0) {
    return " New session started";
  } else {
    // Make LLM call with non-empty messages array
  }
}

Notes

The suggested fix assumes that returning a deterministic response when the messages array is empty is a valid workaround. However, this may need to be adjusted based on the specific requirements of the application.

Recommendation

Apply workaround: Modify the runEmbeddedPiAgent function to check for an empty messages array and return a deterministic response. This should prevent the 400 error and allow the /new command to function as expected.

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