Skip to content

[BUG] Agent loop is not stopped after max iterations reached #3847

@ehansis

Description

@ehansis

Hello all,

It seems to me like the agent loop is not being stopped once max_iter has been reached. handle_max_iterations_exceeded is called and a formatted answer is prepared, but this answer is being overwritten in following LLM calls and the loop is not stopped.

if has_reached_max_iterations(self.iterations, self.max_iter):

A previous revision had a break right after preparing the formatted answer, but this was lost in rev efe27bd.

... or am I missing something here?

Cheers!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions