Skip to content

[BUG] Respect role from BidiTextInputEvent parameter instead of hardcoding 'user' role #2089

@btdeviant

Description

@btdeviant

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.34.1

Python Version

3.13

Operating System

n/a

Installation Method

pip

Steps to Reproduce

The bidi agent loop hardcodes "role": "user" when appending messages from a BidiTextInputEvent, ignoring the event's role property entirely. This means callers who construct a BidiTextInputEvent with role="assistant" (e.g., for injecting assistant context into the conversation history) have that role silently overwritten. The role parameter on BidiTextInputEvent exists specifically to support this — it should be used.

Expected Behavior

The event role attribute should be respected in the bidi agent loop.

Actual Behavior

The hard coded value overrides the role.

Additional Context

No response

Possible Solution

1 line fix -

#2083

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