π Fix: avoid duplicate stream keyword in evaluator LLM calls - #3829
Merged
Conversation
cj2026-bit
requested review from
Dallas98,
WMC001 and
jeffwu-1999
as code owners
August 31, 2026 10:55
Codecov Reportβ All modified and coverable lines are covered by tests. π’ Thoughts on this report? Let us know! |
WMC001
approved these changes
Sep 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Evaluation requests could fail when the evaluator generated system prompts or processed evaluation cases.
The failure was caused by a duplicated
streamkeyword in the evaluator LLM request.Root Cause
The in-process LLM client caching feature was introduced by
PR #3668.
After that change, cached model clients could retain a construction-time
streamparameter in the result of_prepare_completion_kwargs().The normal conversation path was later adapted in
PR #3695 by removing
the stale
streamvalue before forcing streaming.However, the evaluation path was not updated accordingly. It still called:
When completion_kwargs already contained stream=False, Python received
the same keyword twice and raised:
The evaluator then forces streaming by calling:
This passes stream twice and can raise a Python duplicate-keyword error before the request reaches the model.
The normal conversation path already removes the old stream parameter, but the evaluator path did not perform the same adaptation.
Solution
Remove any existing stream value from the prepared completion parameters before forcing evaluator calls to use streaming:
Other completion parameters remain unchanged.
Validation Screenshots