Skip to content

Getting error 400 prompt is too long #986

@nunocoracao

Description

@nunocoracao

Describe the bug
When going on a complex flow that involves lots of tool calls the agent starts getting:

Streaming error occurred: error receiving from stream: POST "/proxy/v1/messages": 400 Bad Request (Request-ID: req_011CVaj97Jg8rUofBMfwZPyY) {"type":"error","error":{"type":"invalid_request_error","message":"prompt is too long: 211154 tokens > 200000 maximum"},"request_id":"req_011CVaj97Jg8rUofBMfwZPyY"}

and the session gets broken

Expectation

I would expect that when the error is received that an automatic compacting of the session occurs and the last request is automatically retried.

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions