Skip to content

fix(bedrock): drop empty messages in Converse encoder#540

Merged
mikehostetler merged 1 commit intoagentjido:mainfrom
jscheid:fix/bedrock-drop-empty-messages
Mar 24, 2026
Merged

fix(bedrock): drop empty messages in Converse encoder#540
mikehostetler merged 1 commit intoagentjido:mainfrom
jscheid:fix/bedrock-drop-empty-messages

Conversation

@jscheid
Copy link
Contributor

@jscheid jscheid commented Mar 23, 2026

Sorry, the previous change (#534) was incomplete... I thought I had tested it but evidently not.

Description

After ContentPart filtering removes blank text parts, a message can end up with an empty content array. Bedrock rejects these with HTTP 400. Return nil from encode_message when content is empty, matching the existing nil-rejection pattern.

Type of Change

  • Bug fix (non-breaking change fixing an issue)
  • New feature (non-breaking change adding functionality)
  • Breaking change (fix or feature causing existing functionality to change)
  • Documentation update

Breaking Changes

N/A

Testing

  • Tests pass (mix test)
  • Quality checks pass (mix quality)

Checklist

  • My code follows the project's style guidelines
  • I have updated the documentation accordingly
  • I have added tests that prove my fix/feature works
  • All new and existing tests pass
  • My commits follow conventional commit format
  • I have NOT edited CHANGELOG.md (it is auto-generated by git_ops)

Related Issues

N/A

After ContentPart filtering removes blank text parts, a message
can end up with an empty content array. Bedrock rejects these
with HTTP 400. Return nil from encode_message when content is
empty, matching the existing nil-rejection pattern.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@mikehostetler mikehostetler merged commit ddc3e91 into agentjido:main Mar 24, 2026
6 checks passed
@jscheid jscheid deleted the fix/bedrock-drop-empty-messages branch March 24, 2026 10:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants