fix: stop Agent retries after output limit - #12303
Conversation
|
@Nikhi00718 is attempting to deploy a commit to the deepset Team on Vercel. A member of the Team first needs to authorize it. |
|
@sjrl Could you please take over this review? Thank you! |
|
@Nikhi00718 please also handle the merge conflicts with main |
d6a340d to
5285cb8
Compare
|
Addressed all review feedback:
Verification:
All four review threads have been replied to and resolved. |
|
Hi @Nikhi00718, thanks a lot for your contribution! 🙏 We noticed that the Contributor License Agreement (CLA) check ( To get your PR reviewed, please sign the CLA via the link in the |
Coverage reportClick to see where and how coverage changed
This report was generated by python-coverage-comment-action |
||||||||||||||||||||||||||||||||||||||||||||||||
|
@sjrl The CLA Assistant says all committers have signed, but the license/cla status is missing on the latest commit and the cla-pending label remains. Could you please retrigger the CLA check and review assignment? |
Yeah sorry about that. I'll be able to finish reviewing this early next week and look into the bot issue. |
|
Thanks for signing the CLA, @Nikhi00718! 🎉 This PR is now ready for review again and the reviewer has been re-assigned. |
Related Issues
Agentloops tomax_agent_stepswhen a reasoning model returns no text because it hitsmax_output_tokens#12300Proposed Changes:
max_output_tokensto Haystack's existinglengthfinish reason in both streaming and non-streaming paths.textAgent exit, while retaining the retry behavior for other empty replies such as discarded malformed tool calls.How did you test it?
C:\Program Files\Hatch\hatch.exe run test:unit test/components/agents/test_agent.py test/components/generators/chat/test_openai_responses_conversion.py(121 passed, 4 integration tests deselected)C:\Program Files\Hatch\hatch.exe run test:unit test/components/generators/chat(251 passed, 43 integration tests deselected)C:\Program Files\Hatch\hatch.exe run test:typesC:\Program Files\Hatch\hatch.exe run ruff check --fixC:\Program Files\Hatch\hatch.exe run ruff formatC:\Program Files\Hatch\hatch.exe run pre-commit run --files ...(all scoped hooks passed)Notes for the reviewer
The new Agent regression tests fail on
mainbecause the Agent makes a second model call after a length-truncated empty response. The Responses conversion regressions also fail onmainbecause the same condition is exposed asstopin streaming mode and has no normalized finish reason in non-streaming mode.hatch run fmtis not directly executable on Windows because the repository script's Unix-style semicolon is passed literally to Ruff; the two configured Ruff commands above were run separately through Hatch.AI assistance disclosure
I identified and reproduced the issue, then used OpenAI Codex to assist with the implementation and regression-test work. I personally reviewed the resulting diff and ran the validation commands listed above to verify the fix. Any full-suite or local-environment limitations are documented in the validation section.
Checklist