Skip to content

Conversation

@dcondrey
Copy link

@dcondrey dcondrey commented Nov 5, 2025

Related Issues

Proposed Changes:

Previously, if step_countmax_agent_steps and last_msgToolResult, output = ToolResult (no final text).

Now, if step_countmax_agent_steps and last_msg ∈ ToolResult, optionally perform 1 extra LLM call → final_text_answer.

How did you test it?

  • Files compile without Python syntax errors
  • Fixed critical async bug
  • Two new tests in test/components/agents/test_agent.py

Notes for the reviewer

hatch run test:unit test/components/agents/test_agent.py::TestAgent::test_final_answer_on_max_steps_enabled
hatch run test:unit test/components/agents/test_agent.py::TestAgent::test_final_answer_on_max_steps_disabled
hatch run test:unit test/components/agents/test_agent.py::TestAgent::test_exceed_max_steps

Checklist

✓ I have read the contributors guidelines and the code of conduct

  • I have updated the related issue with new insights and changes
    ✓ I added unit tests and updated the docstrings
    ✓ I've used one of the conventional commit types for my PR title: fix:, feat:, build:, chore:, ci:, docs:, style:, refactor:, perf:, test: and added ! in case the PR includes breaking changes.
    ✓ I documented my code
    ✓✓ I ran pre-commit hooks and fixed any issue

@dcondrey dcondrey requested a review from a team as a code owner November 5, 2025 02:10
@dcondrey dcondrey requested review from vblagoje and removed request for a team November 5, 2025 02:10
@vercel
Copy link

vercel bot commented Nov 5, 2025

@dcondrey is attempting to deploy a commit to the deepset Team on Vercel.

A member of the Team first needs to authorize it.

@CLAassistant
Copy link

CLAassistant commented Nov 5, 2025

CLA assistant check
All committers have signed the CLA.

@github-actions github-actions bot added topic:tests type:documentation Improvements on the docs labels Nov 5, 2025
@sjrl sjrl requested review from sjrl and removed request for vblagoje November 5, 2025 07:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

topic:tests type:documentation Improvements on the docs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

2 participants