Skip to content

[BUG] BedrockModel streaming delivers chunks in batches sometimes instead of individual stream events #1523

@JackYPCOnline

Description

@JackYPCOnline

Checks

  • I have updated to the lastest minor and patch version of Strands
  • I have checked the documentation and this is not expected behavior
  • I have searched ./issues and there are no duplicates of my issue

Strands Version

1.21

Python Version

3.13

Operating System

macOS 12.6

Installation Method

pip

Steps to Reproduce

A customer's service use Swarm with strands agent in their package When using Strands SDK's BedrockModel for streaming responses, chunks arrive in batches rather than as individual stream events. This breaks the natural streaming experience and causes poor user experience in applications expecting real-time streaming.

We might need to look into this line of

loop.call_soon_threadsafe(queue.put_nowait, event)

Expected Behavior

  • Chunks should arrive individually with natural pacing, similar to direct Bedrock API calls
  • Streaming should feel smooth and real-time to end users

Actual Behavior

  • Multiple chunks arrive simultaneously in batches
  • Streaming appears "bursty" rather than smooth
  • Poor user experience compared to direct Bedrock converse_stream calls

Additional Context

No response

Possible Solution

No response

Related Issues

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions