[BUG] AI Assistant throws 400 invalid_request_error - empty message content blocks sent to Claude API

Resolved 💬 3 comments Opened Feb 20, 2026 by TMobileDeveloper Closed Mar 27, 2026

Preflight Checklist

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

What's Wrong?

The AI Assistant plugin intermittently sends malformed requests to the Claude (Anthropic) API, resulting in a 400 Bad Request error approximately every 10 requests.

Error message:

com.anthropic.errors.BadRequestException: 400: {
type=error,
error={
type=invalid_request_error,
message=messages: text content blocks must be non-empty
}
}

What Should Happen?

Every request should include a valid, non-empty message body

Error Messages/Logs

com.anthropic.errors.BadRequestException: 400: {
  type=error, 
  error={
    type=invalid_request_error, 
    message=messages: text content blocks must be non-empty
  }
}

Steps to Reproduce

  1. Use the AI Assistant with Claude as the selected model
  2. Send approximately 10 requests in a session
  3. The error appears intermittently without any change in behavior from the user side

Claude Model

Sonnet (default)

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

2.1.49

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

IntelliJ IDEA terminal

Additional Information

The error happens in Android Studio AI Chat which has access to Claude models using API key

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗