Skip to content

Agent can exit on tool call when max_agent_steps is reached, not guaranteeing a final text answer #10001

@Hansehart

Description

@Hansehart

Is your feature request related to a problem? Please describe.
When an Agent reaches max_agent_steps, it stops immediately - even if the last message is from a tool invocation. This results in no final text response from the LLM, which could be problematic if you expect that the agent answers with natural language

Describe the solution you'd like
When max_agent_steps is reached, there could be a setting that the agent:

  1. Detect if the last message is from a tool call
  2. Make ONE final call to the chat generator (without tools)
  3. Return a proper text response

Describe alternatives you've considered
Locally I built a AlwaysAnswerAgent (AAA). My max_agent_steps are low to prevent minute long runs. I want that my agent tells if he has problems with the provided input instead digging for minutes to the wrong result. However when I set max_agent_steps e.g to 10, I receive a tool call output, that I cant display to the user. So I built my AAA that when the threshold is hit, summarizes what he tried so far. So the main goal is to end always with a ChatGenerator/Generator that dont call again tools.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Medium priority, add to the next sprint if no P1 available

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions