mirror of
https://github.com/CopilotKit/CopilotKit.git
synced 2026-09-14 16:26:20 +08:00
4a27087094
The Python unit tests for stop_on_terminal_text / simple_after_model_modifier built fake LlmResponse objects without a finish_reason field. That worked before the thinking-mode fix in #4826, which added a finish_reason="STOP" gate so the callback no longer terminates on text-only chunks that arrive non-partial with finish_reason=None (Gemini thinking-mode emits a text-only chunk first, then a separate function-call chunk — terminating on the first would skip the second). Fix: default the fake response's finish_reason to "STOP" (the real terminal-response shape) and also stub turn_complete=None so the matcher path the callback walks lines up with what production sees. Local pytest on Python 3.10 → 23/23 green.