openclaw - 💡(How to fix) Fix /new command without text triggers empty LLM request (400 messages: Field required) [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#74539Fetched 2026-04-30 06:23:19
View on GitHub
Comments
1
Participants
2
Timeline
2
Reactions
2
Author
Timeline (top)
closed ×1commented ×1

When the /new slash command is sent without any message text, OpenClaw resets the session and immediately fires an LLM request with an empty messages array, causing a 400 error from the API.

Error Message

When the /new slash command is sent without any message text, OpenClaw resets the session and immediately fires an LLM request with an empty messages array, causing a 400 error from the API. 2. Observe the error

Error Log

400 {"type":"error","error":{"type":"invalid_request_error","message":"messages: Field required"}}

Root Cause

When the /new slash command is sent without any message text, OpenClaw resets the session and immediately fires an LLM request with an empty messages array, causing a 400 error from the API.

Fix Action

Workaround

Use /new <some text> instead of bare /new.

Code Example

Embedded agent failed before reply: All models failed (2):
400 {"type":"error","error":{"type":"invalid_request_error","message":"messages: Field required"}}
LLM request rejected: messages: Field required
RAW_BUFFERClick to expand / collapse

Bug Report

Version: OpenClaw 2026.4.26 Channel: Telegram

Description

When the /new slash command is sent without any message text, OpenClaw resets the session and immediately fires an LLM request with an empty messages array, causing a 400 error from the API.

Steps to Reproduce

  1. Send /new (without any text after it) in a Telegram chat
  2. Observe the error

Error Log

Embedded agent failed before reply: All models failed (2):
400 {"type":"error","error":{"type":"invalid_request_error","message":"messages: Field required"}}
LLM request rejected: messages: Field required

Expected Behavior

/new should reset the session and wait for the next user message. No API call should be made when there is no message content.

Workaround

Use /new <some text> instead of bare /new.

extent analysis

TL;DR

Check the handling of the /new slash command to ensure it waits for user input before making an LLM request when no message text is provided.

Guidance

  • Review the code that handles the /new command to verify it correctly checks for the presence of message text before initiating an LLM request.
  • Consider adding a conditional statement to delay the LLM request until a subsequent message with text is received.
  • Examine the error handling for the LLM request to ensure it properly handles the "Field required" error and does not reset the session unnecessarily.
  • Test the /new command with and without message text to confirm the expected behavior.

Example

if message_text:
    # Proceed with LLM request
else:
    # Wait for next user message
    # possibly set a flag or store the command for later use

Notes

The provided workaround suggests that adding text to the /new command resolves the issue, indicating the problem lies in how the command is handled when no text is provided.

Recommendation

Apply workaround: Use /new <some text> instead of bare /new until a fix is implemented to handle the command correctly without text. This ensures the LLM request is made with the required messages field.

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