mirror of
https://github.com/DayuanJiang/next-ai-draw-io.git
synced 2026-01-02 22:32:27 +08:00
* fix: filter out messages with empty content arrays for Bedrock API The convertToModelMessages function from AI SDK can produce messages with empty content arrays when assistant messages have only tool call parts or when tool results aren't properly converted. Bedrock API rejects these with 400 errors. This fix filters out invalid messages before sending to the API. * fix: add diagnostic logging for empty message content Added logging to capture the original UI message structure when empty content is detected after conversion. This helps debug the root cause while the filter provides a safety net for Bedrock API compatibility.