Open
Conversation
kylexqian
approved these changes
Apr 24, 2026
Collaborator
kylexqian
left a comment
There was a problem hiding this comment.
From testing it seems to fix the issues!
============================================================
Scenario: Text response with tools in request
============================================================
Chunk 1: is_final=False finish_reason=None
content: 'The sky appears'
Chunk 2: is_final=False finish_reason=None
content: " blue due to a phenomenon called Rayleigh scattering. When sunlight enters the Earth's atmosphere, it coll"
Chunk 3: is_final=False finish_reason=None
content: 'ides with the gas molecules in the air. Shorter wavelengths of light, like blue and violet, are scattered more effectively in all directions than longer wavelengths, like red and orange. Our eyes are more sensitive to blue than violet, so we perceive'
Chunk 4: is_final=False finish_reason=None
content: ' the sky as blue.'
Chunk 5: is_final=True finish_reason=stop
Total chunks: 5
DIAGNOSIS: [AFTER FIX] — real SSE streaming (multiple chunks)
============================================================
Scenario: Tool call response (tool_calls in stream)
============================================================
Chunk 1: is_final=False finish_reason=None
tool_calls: [{'index': None, 'type': 'function', 'function': {'name': 'get_current_weather', 'arguments': '{"city": "Dallas, TX", "unit": "fahrenheit"}'}, 'id': '1b0602d0-82ac-4d90-a1dc-2058cbfc29db'}]
Chunk 2: is_final=True finish_reason=tool_calls
Total chunks: 2
DIAGNOSIS: [AFTER FIX] — real SSE streaming (multiple chunks)
============================================================
Scenario: Text + tool call in same response (best-effort)
============================================================
Chunk 1: is_final=False finish_reason=None
content: 'I will look'
Chunk 2: is_final=False finish_reason=None
content: ' up the weather in Dallas, TX and respond with the temperature in Fahrenheit.'
Chunk 3: is_final=False finish_reason=None
tool_calls: [{'index': None, 'type': 'function', 'function': {'name': 'get_current_weather', 'arguments': '{"city": "Dallas, TX", "unit": "fahrenheit"}'}, 'id': '2c14850a-407a-4d88-8451-ed82dbde7563'}]
Chunk 4: is_final=True finish_reason=tool_calls
Total chunks: 4
DIAGNOSIS: [AFTER FIX] — real SSE streaming (multiple chunks)
============================================================
SUMMARY
============================================================
Text response with tools in request
chunks=5 text=True tool_calls=False → STREAMING (after fix)
Tool call response (tool_calls in stream)
chunks=2 text=False tool_calls=True → STREAMING (after fix)
Text + tool call in same response (best-effort)
chunks=4 text=True tool_calls=True → STREAMING (after fix) [text+tool_call]
Scenario C: model produced both text and tool_call chunks in one response.
OVERALL: PASS — streaming works with tools
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.
No description provided.