claude-code - 💡(How to fix) Fix [BUG] Dispatch stuck in a loop of error 400 stating content contains white-space [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
anthropics/claude-code#45217Fetched 2026-04-09 08:10:32
View on GitHub
Comments
1
Participants
2
Timeline
5
Reactions
0
Timeline (top)
labeled ×4commented ×1

Error Message

API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"messages: text content blocks must contain non-whitespace text"},"request_id":"req_011CZrP7s3mCDydNmBhXsh9G"}

Fix Action

Fix / Workaround

After getting caught in a loop on a response, dispatch continues to throw the following error: API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"messages: text content blocks must contain non-whitespace text"},"request_id":"req_011CZrP7s3mCDydNmBhXsh9G"}

I've cleared cache both in browser and desktop app and restarted. logged out and in. Claude code works fine, just not dispatch ever since it got caught in the loop

Code Example

API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"messages: text content blocks must contain non-whitespace text"},"request_id":"req_011CZrP7s3mCDydNmBhXsh9G"}
RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • I am using the latest version of Claude Code

What's Wrong?

After getting caught in a loop on a response, dispatch continues to throw the following error: API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"messages: text content blocks must contain non-whitespace text"},"request_id":"req_011CZrP7s3mCDydNmBhXsh9G"}

I've cleared cache both in browser and desktop app and restarted. logged out and in. Claude code works fine, just not dispatch ever since it got caught in the loop

<img width="1128" height="1048" alt="Image" src="https://github.com/user-attachments/assets/6147e3ca-40fc-4ce4-b63d-d46b37a1d76e" /> <img width="1172" height="1092" alt="Image" src="https://github.com/user-attachments/assets/823c3966-ba22-4737-adb4-36fdb829e892" />

What Should Happen?

It shouldn't error for no reason LOL

Error Messages/Logs

API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"messages: text content blocks must contain non-whitespace text"},"request_id":"req_011CZrP7s3mCDydNmBhXsh9G"}

Steps to Reproduce

I have no idea how to reproduce it, it simply throws the error every time I send a message now.

Claude Model

Opus

Is this a regression?

I don't know

Last Working Version

No response

Claude Code Version

1.1062.0 (b81bcd)

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

No response

extent analysis

TL;DR

  • The issue can likely be resolved by ensuring that the text content blocks in the messages sent through the dispatch contain non-whitespace text.

Guidance

  • Verify that the messages being sent do not contain only whitespace characters, as the error message suggests that this is the cause of the issue.
  • Check the code that generates the messages for any potential bugs that could be causing empty or whitespace-only messages to be sent.
  • Consider adding error checking to ensure that messages contain valid text before sending them through the dispatch.
  • Review the documentation for the Anthropics API to see if there are any specific requirements for message formatting that may be causing the issue.

Example

  • No specific code example can be provided without more information about the code being used, but a general example of how to check for non-whitespace text in a message might look like this:
if message.strip() != "":
    # Send the message
else:
    # Handle the error or add default text

Notes

  • The exact cause of the issue is unclear, as the steps to reproduce the error are not well-defined, but the error message provides a strong hint about the potential cause.
  • The issue may be related to a specific bug in the Claude Code or Anthropics API, but without more information, it is difficult to say for certain.

Recommendation

  • Apply workaround: The best course of action appears to be adding error checking to ensure that messages contain valid text before sending them, as this will prevent the API error from occurring.

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