Skip to content

return error if no messages are available after conversion#1720

Merged
dgageot merged 1 commit intodocker:mainfrom
krissetto:fix-anthropic-empty-messages
Feb 13, 2026
Merged

return error if no messages are available after conversion#1720
dgageot merged 1 commit intodocker:mainfrom
krissetto:fix-anthropic-empty-messages

Conversation

@krissetto
Copy link
Contributor

no need to send those requests to the provider since they are invalid

no need to send those requests to the provider since they are invalid

Signed-off-by: Christopher Petito <chrisjpetito@gmail.com>
@krissetto krissetto requested a review from a team as a code owner February 13, 2026 15:26
Copy link

@docker-agent docker-agent bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Summary

No issues found

The changes look good! The PR adds appropriate error handling to prevent invalid API calls when message conversion results in empty message lists. The implementation is:

  • Correctly placed: Error checks happen after conversion but before API calls
  • Clear messaging: Error messages are descriptive and actionable
  • Well-tested: Comprehensive test coverage for nil messages, empty messages, system-only messages, and whitespace-only content
  • Consistent: Same pattern applied to both beta_client.go and client.go

The error handling will prevent unnecessary API calls and provide clearer feedback when messages are filtered out during conversion.

@dgageot dgageot merged commit cf6064a into docker:main Feb 13, 2026
8 checks passed
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