aws-samples / aws-samples/bedrock-chat
[BUG]Claude 4.0 (Sonnet) unresponsive due to ValidationException: empty message content
- Dominant language
- TypeScript
- Stars
- 1.3k
- Forks
- 535
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 10
Description
## 🐞Describe the bug
When using Claude 4.0 (Sonnet) in BedrockChat, the system freezes during AI response generation and no response is returned.
**Confirmed facts:**
- Lambda runtime errors occur when Claude 4.0 (Sonnet) becomes unresponsive
- Claude 4.5 (Haiku) works normally (returns responses without delay)
- Unresponsive behavior occurs when "Extended Thinking" is **disabled**
- Normal operation occurs when "Extended Thinking" is **enabled**
- Reproduced with identical input content, only difference being Extended Thinking enabled/disabled
## 🔄 To Reproduce
Steps to reproduce:
1. Open BedrockChat
2. Select Claude 4.0 (Sonnet)
3. **Disable** the "Extended Thinking" feature
4. Enter a question in the chat
5. System freezes during AI response generation and no response is returned
**Confirmed behaviors:**
- Issue persists after clearing browser cache
- Issue persists in different browsers
- Claude 4.5 (Haiku) works without issues
## 📷 Screenshots
## 🔎 Logs for Chat Issues
**Occurrence pattern:**
Occurs randomly. The timing of unresponsive behavior matches the Lambda error log timestamps.
**Lambda Error Logs:**
The following errors were detected in CloudWatch Logs (Occurrence time: 2025-12-17 11:15:36):
```
2025-12-17 11:15:36.229 | ERROR:app.main - An error occurred (ValidationException) when calling the Converse operation: The content field in the Message object at messages.1 is empty. Add a ContentBlock object to the content field and try again.
2025-12-17 11:15:36.247 | ERROR:app.main - File "/var/task/starlette/middleware/errors.py", line 165, in __call__
2025-12-17 11:15:36.338 | ERROR: Exception in ASGI application
2025-12-17 11:15:36.339 | ERROR Lambda runtime invoke{requestId="abe07513-00b9-440c-806c-7d1eae8cb92d" xrayTraceId="Root=1-694290d8-6a300bca05b0c92744b6bfec;Parent=58b0f731932f9c78;Sampled=0;Lineage=1:ffe5f926:0"}: lambda_runtime: Error { kind: SendRequest, source: Some(hyper::Error(Io, Os { code: 104, kind: ConnectionReset, message: "Connection reset by peer" })) }
```
**CloudWatch Logs Query:**
```
fields @timestamp, @message
| filter @message like /ERROR/
| sort @timestamp desc
| limit 10000
```
## 🔎 Logs for Bot Creation/Update Issues
N/A - This is a chat-related issue
## 📝 Additional context
### Environment Information
- **Deployment Version**: v3.15.1
### Summary of Behavior Testing
| Model | Extended Thinking | Result |
|--------|----------|------|
| Claude 4.0 (Sonnet) | Disabled | ❌ Unresponsive/Freeze (Lambda errors occur) |
| Claude 4.0 (Sonnet) | Enabled | ✅ Normal operation |
| Claude 4.5 (Haiku) | Disabled | ✅ Normal operation (no delay) |
### Expected Behavior
Claude 4.0 (Sonnet) should operate normally regardless of whether Extended Thinking is enabled or disabled
Contributor guide
Research direction
Start with the BedrockChat chat flow and the Converse operation referenced in the Lambda and CloudWatch errors, then reproduce the Claude 4.0 Sonnet case with Extended Thinking disabled. Done means the empty-message ValidationException no longer occurs and Claude 4.0 responds normally with Extended Thinking both enabled and disabled, while the existing Haiku behavior remains intact.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, python, typescript
- Domain
- ai, backend, cloud
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100