claude-code icon indicating copy to clipboard operation
claude-code copied to clipboard

Bug Report all messages must have non-empty content except for the optional final assistant message

Open jiwoo-dev opened this issue 5 months ago • 8 comments

Bug Description

Environment Info

  • Platform: linux
  • Terminal: vscode
  • Version: 1.0.53
  • Feedback ID: 507f7995-4b4c-4975-ae1c-760aac7db5ab

Errors

[{"error":"Error: 400 {\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"messages.0: all messages must have non-empty content except for the optional final assistant message\"}}\n    at eQ.generate (file:///home/mman/.npm-global/lib/node_modules/@anthropic-ai/claude-code/cli.js:1180:6428)\n    at k$.makeStatusError (file:///home/mman/.npm-global/lib/node_modules/@anthropic-ai/claude-code/cli.js:1197:2101)\n    at k$.makeRequest (file:///home/mman/.npm-global/lib/node_modules/@anthropic-ai/claude-code/cli.js:1197:5315)\n    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)","timestamp":"2025-07-17T04:25:01.491Z"}]

jiwoo-dev avatar Jul 17 '25 04:07 jiwoo-dev

I get this a lot in Claude Code as well, no idea what's happening cos clearly the prompt wasn't empty

wyuenho avatar Jul 18 '25 18:07 wyuenho

same, seeing this a ton on macOS

pirate avatar Aug 05 '25 22:08 pirate

I am repeatedly encountering this issue, and only ending the session and restarting (and losing the context) resolves it for a time.

  • Platform: MacOS 15.5 (24F74)
  • Version: Claude Version 1.0.90
  • Terminal: zsh 5.9 (arm64-apple-darwin24.0)

API Error: 400

{"type":"error","error":{"type":"invalid_request_error","message":"messages.55: all messages must have non-empty content except for the optional final assistant message"},"request_id":"req_012CBWBhLqyec5MTmFgDnauE"}

nick-myers-dt avatar Aug 26 '25 11:08 nick-myers-dt

I am also seeing this error -- happy to share context data if helpful.

groeney avatar Aug 29 '25 21:08 groeney

I'm also experiencing this and it's a really annoying bug as the only way to fix it is to restart claude, which means losing all context. Would be great to get this fixed.

davidpasztor avatar Oct 16 '25 17:10 davidpasztor

This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.

github-actions[bot] avatar Dec 08 '25 10:12 github-actions[bot]

bump for stopping the autoclose.

notkearash avatar Dec 08 '25 18:12 notkearash