Skip to content

fix(bedrock): preserve payload event types in stream decoder#1718

Open
nightcityblade wants to merge 1 commit into
anthropics:mainfrom
nightcityblade:fix/issue-1647
Open

fix(bedrock): preserve payload event types in stream decoder#1718
nightcityblade wants to merge 1 commit into
anthropics:mainfrom
nightcityblade:fix/issue-1647

Conversation

@nightcityblade

Copy link
Copy Markdown

Fixes #1647.

This updates the Bedrock event-stream decoder to preserve the payload's own type field instead of hardcoding every chunk to completion. Payloads that aren't Anthropic Messages events, such as amazon-bedrock-invocationMetrics, are now dropped at the decoder boundary instead of being mis-routed into the stream-event union.

Validation:

  • PYTHONPATH=src python3 -m pytest tests/lib/test_bedrock_stream_decoder.py

@nightcityblade nightcityblade requested a review from a team as a code owner June 30, 2026 03:22
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.

Bedrock stream decoder drops SSE event types; type-less chunks construct as RawMessageStartEvent(message=None)

1 participant