Skip to content

[BUG] force slidingWindowConversationManager to use user message. Currently, it could start with an assistant message. #2085

@vedashreevinay

Description

@vedashreevinay

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

Python Version

3.13

Operating System

macOS26.3.1

Installation Method

pip

Steps to Reproduce

  1. Create an agent with Nova 2 Lite as the model using Amazon Bedrock provider.
  2. Set the slidingwindow size to be lower to hit the window limit earlier.
  3. Generate enough conversations with the agent to fill up the sliding window size
  4. User will hit a ValidationException: A conversation must start with a user message

Expected Behavior

Even after the sliding window size is reached, the context sent to the model should always start with a user message. No ValidationExceptions.

Actual Behavior

ValidationException: A conversation must start with a user message

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