Uh oh!
There was an error while loading. Please reload this page.
fix: filter empty content blocks for Bedrock provider - #17381
Conversation
- Filter empty text blocks from tool-result content arrays - Skip empty text in tool output when attachments exist - Replace assistant content "" with null for openai-compatible API Fixesanomalyco#16332
The following comment was made by an LLM, it may be inaccurate: Based on the search results, I found a potentially related PR: PR #17363: "fix: empty tool-result content and cache control level for custom @ai…" Why it might be related: This PR also addresses empty tool-result content issues, which overlaps with the current PR's handling of empty text blocks in tool-result content arrays. Both are fixing similar validation issues related to tool-result content formatting. The other results (PRs #16750, #16751, #8497, #8958) address related but distinct issues (tool_use/tool_result mismatches, dangling blocks, thinking blocks) rather than the specific empty content block filtering problem. |
Fixes Bedrock ValidationException errors caused by empty text content blocks in three scenarios:
Issue for this PR
Closes#16332
Type of change
What does this PR do?
content: ""tocontent: nullin openai-compatible fetch hookIf you paste a large clearly AI generated description here your PR may be IGNORED or CLOSED!
How did you verify your code works?
bun testfrom packages/opencode - all tests passedbun typecheckfrom packages/opencode - all checks passedScreenshots / recordings
If this is a UI change, please include a screenshot or recording.
Checklist
If you do not follow this template your PR will be automatically rejected.