Invalid API Request: Empty Message Content Violation
Resolved 💬 1 comment Opened Jun 19, 2025 by keevingfu Closed Jun 19, 2025
Bug Description
API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"messages.63: all messages must have non-empty content except
for the optional final assistant message"}}
Environment Info
- Platform: darwin
- Terminal: xterm-256color
- Version: 1.0.29
- Feedback ID: 38518064-80fa-49ea-bed8-c1631d400f3b
Errors
[{"error":"Error: Command failed: security find-generic-password -a $USER -w -s \"Claude Code\"\nsecurity: SecKeychainSearchCopyNext: The specified item could not be found in the keychain.\n\n at genericNodeError (node:internal/errors:983:15)\n at wrappedFn (node:internal/errors:537:14)\n at checkExecSyncError (node:child_process:882:11)\n at execSync (node:child_process:954:15)\n at EZ (file:///usr/local/lib/node_modules/@anthropic-ai/claude-code/cli.js:659:3921)\n at file:///usr/local/lib/node_modules/@anthropic-ai/claude-code/cli.js:582:9014\n at Q (file:///usr/local/lib/node_modules/@anthropic-ai/claude-code/cli.js:526:17199)\n at QX (file:///usr/local/lib/node_modules/@anthropic-ai/claude-code/cli.js:582:8160)\n at qS (file:///usr/local/lib/node_modules/@anthropic-ai/claude-code/cli.js:582:7241)\n at L9 (file:///usr/local/lib/node_modules/@anthropic-ai/claude-code/cli.js:582:11408)","timestamp":"2025-06-19T10:21:36.187Z"},{"error":"Error: connect ECONNRESET 198.18.1.35:443\n at vx.from (file:///usr/local/lib/node_modules/@anthropic-ai/claude-code/cli.js:526:44022)\n at PY.h1 (file:///usr/local/lib/node_modules/@anthropic-ai/claude-code/cli.js:529:10131)\n at PY.emit (node:events:518:28)\n at PY.emit (node:domain:489:12)\n at CM1.<computed> (file:///usr/local/lib/node_modules/@anthropic-ai/claude-code/cli.js:61:1149)\n at ClientRequest.emit (node:events:518:28)\n at ClientRequest.emit (node:domain:489:12)\n at emitErrorEvent (node:_http_client:104:11)\n at TLSSocket.socketErrorListener (node:_http_client:518:5)\n at TLSSocket.emit (node:events:518:28)\n at jl.request (file:///usr/local/lib/node_modules/@anthropic-ai/claude-code/cli.js:531:2081)\n at process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n at async U0A (file:///usr/local/lib/node_modules/@anthropic-ai/claude-code/cli.js:2292:225)","timestamp":"2025-06-19T10:21:36.252Z"},{"error":"Error: 400 {\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"messages.63: all messages must have non-empty content except for the optional final assistant message\"}}\n at d6.generate (file:///usr/local/lib/node_modules/@anthropic-ai/claude-code/cli.js:1300:12578)\n at Ow.makeStatusError (file:///usr/local/lib/node_modules/@anthropic-ai/claude-code/cli.js:1315:2082)\n at Ow.makeRequest (file:///usr/local/lib/node_modules/@anthropic-ai/claude-code/cli.js:1315:5257)\n at process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n at async RE2.L11.showErrors (file:///usr/local/lib/node_modules/@anthropic-ai/claude-code/cli.js:1670:22466)\n at async L11 (file:///usr/local/lib/node_modules/@anthropic-ai/claude-code/cli.js:1670:12368)\n at async RE2 (file:///usr/local/lib/node_modules/@anthropic-ai/claude-code/cli.js:1670:22312)\n at async file:///usr/local/lib/node_modules/@anthropic-ai/claude-code/cli.js:1670:17441\n at async nt1 (file:///usr/local/lib/node_modules/@anthropic-ai/claude-code/cli.js:1670:5121)\n at async Hu (file:///usr/local/lib/node_modules/@anthropic-ai/claude-code/cli.js:1670:17411)","timestamp":"2025-06-19T10:48:03.421Z"},{"error":"Error: 400 {\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"messages.63: all messages must have non-empty content except for the optional final assistant message\"}}\n at d6.generate (file:///usr/local/lib/node_modules/@anthropic-ai/claude-code/cli.js:1300:12578)\n at Ow.makeStatusError (file:///usr/local/lib/node_modules/@anthropic-ai/claude-code/cli.js:1315:2082)\n at Ow.makeRequest (file:///usr/local/lib/node_modules/@anthropic-ai/claude-code/cli.js:1315:5257)\n at process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n at async RE2.L11.showErrors (file:///usr/local/lib/node_modules/@anthropic-ai/claude-code/cli.js:1670:22466)\n at async L11 (file:///usr/local/lib/node_modules/@anthropic-ai/claude-code/cli.js:1670:12368)\n at async RE2 (file:///usr/local/lib/node_modules/@anthropic-ai/claude-code/cli.js:1670:22312)\n at async file:///usr/local/lib/node_modules/@anthropic-ai/claude-code/cli.js:1670:17441\n at async nt1 (file:///usr/local/lib/node_modules/@anthropic-ai/claude-code/cli.js:1670:5121)\n at async Hu (file:///usr/local/lib/node_modules/@anthropic-ai/claude-code/cli.js:1670:17411)","timestamp":"2025-06-19T10:52:43.510Z"}]This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗