Skip to content

Commit 9cd4310

Browse files
Serhan-Asadclaude
andauthored
fix: prevent Groq message mutation in structured output fallback (#562) (#591)
* test: add failing tests for Groq message mutation bug (#562) Add unit tests and E2E tests that detect the bug where the Groq structured output code path in llm_invoke.py mutates the shared formatted_messages list in-place, corrupting fallback model messages. - 5 unit tests covering both mutation vectors (list .insert() and dict content overwrite) plus cumulative corruption - 3 E2E tests exercising real CSV loading and model selection with only litellm.completion mocked All 8 tests fail on current code and will pass once the fix (copy.deepcopy at line 1966) is applied. Fixes #562 * fix: deep copy formatted_messages to prevent Groq structured output mutation corrupting fallback models (#562) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * test: trim Groq mutation tests to 3 focused regressions in test_llm_invoke.py (#562) Replace 770 lines across 2 standalone test files with 3 focused regression tests (~80 lines) in the existing test_llm_invoke.py, per PR #591 review. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 0213ea7 commit 9cd4310

File tree

0 file changed

+0
-0
lines changed

    0 file changed

    +0
    -0
    lines changed

    0 commit comments

    Comments
     (0)