Skip to content

🐛 Fix: avoid duplicate stream keyword in evaluator LLM calls - #3836

Merged
Dallas98 merged 1 commit into
mainfrom
codex/fix-evaluation-stream-main
Sep 1, 2026
Merged

🐛 Fix: avoid duplicate stream keyword in evaluator LLM calls#3836
Dallas98 merged 1 commit into
mainfrom
codex/fix-evaluation-stream-main

Conversation

@cj2026-bit

@cj2026-bit cj2026-bit commented Sep 1, 2026

Copy link
Copy Markdown
Collaborator

Summary

Backport the evaluator stream compatibility fix from PR #3829 to main without waiting for the next release.

Problem

The in-process LLM client caching feature introduced reusable model clients. After that change, the evaluator path was not adapted to cached completion parameters.

When _prepare_completion_kwargs() retained a construction-time stream value, the evaluator also passed stream=True, which could result in:

TypeError: got multiple values for keyword argument 'stream'

This affected evaluator-related requests such as AI-generated evaluation sets, AI-generated evaluators, and LLM Judge evaluation calls.

The normal conversation path already removed the stale parameter, but the evaluator path was missing the same compatibility handling.

Solution

Remove any existing stream value before forcing evaluator requests to use streaming:

completion_kwargs.pop('stream', None)
current_request = llm.client.chat.completions.create(stream=True, **completion_kwargs)

Other completion parameters are preserved unchanged.

Tests

Added a regression test that simulates a cached client returning stream=False and verifies that the final request contains only stream=True.

Validation

  • Targeted unit tests: 69 passed
  • Config, Runtime, and frontend local health checks: passed
  • Full unit-test workflow: passed
  • Codecov patch coverage: 100%
  • Docker build, SonarCloud, and CodeQL checks: passed

Scope

Only the evaluator compatibility fix and its regression test are included. No API, database schema, or model configuration changes.

Validation Screenshots

7a84c54c-600b-44e6-a962-b9a7ff4eb1ae 046b6ce3-02c4-4297-8b67-a864aaf20b5a

@cj2026-bit cj2026-bit changed the title fix(evaluation): backport cached stream compatibility to main 🐛 Fix: avoid duplicate stream keyword in evaluator LLM calls Sep 1, 2026
@Dallas98
Dallas98 merged commit 9e7291f into main Sep 1, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants