Skip to content

Unhandled "too many images" error from AWS Bedrock when using browser toolΒ #6348

@koberghe

Description

@koberghe

App Version

3.24.0

API Provider

AWS Bedrock

Model Used

Claude 4 Sonnet

Roo Code Task Links (Optional)

When using the Bowser tool continuously in a single chat, the application throws an unhandled API error from AWS Bedrock once the conversation history contains more than 20 images:
"Unknown Error: The model returned the following errors: too many images and documents: 21 + 0 > 20"

This halts the workflow and requires starting a new chat.

πŸ” Steps to Reproduce

  1. Start a chat using a Claude 4 model on AWS Bedrock.
  2. Use the Bowser tool unitl 21 screenshots have accumulated in the same session.
  3. On the 21st image, the application fails.

πŸ’₯ Outcome Summary

Actual Behavior: The app sends all 21+ images to the model, causing the API to return a hard error.

Expected Behavior: The app should gracefully handle this limit. For example, it could automatically discard the oldest images and send only the 20 most recent ones to the model, allowing the chat to continue without error.

The frontend UI already appears to have a similar logic (appendImages) to limit images per-message.

πŸ“„ Relevant Logs or Errors (Optional)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue - Needs ScopingValid, but needs effort estimate or design input before work can start.bugSomething isn't working

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions