Skip to content

Conversation

@rabi
Copy link
Contributor

@rabi rabi commented Jan 1, 2026

Summary

Some OpenAI-compatible APIs send interleaved chunks with content:null between tool_calls chunks during streaming. This caused premature termination of argument accumulation, resulting in empty tool call arguments.

Changes:

  • Remove early done=true when chunk has no tool_calls
  • Accept any finish_reason (not just 'tool_calls') to mark completion

Type of Change

  • Feature
  • Bug fix
  • Refactor / Code quality
  • Performance improvement
  • Documentation
  • Tests
  • Security fix
  • Build / Release
  • Other (specify below)

AI Assistance

  • This PR was created or reviewed with AI assistance

Testing

Tested with vllm and open source models

…t accumulation

Some OpenAI-compatible APIs send interleaved chunks with content:null between
tool_calls chunks during streaming. This caused premature termination of
argument accumulation, resulting in empty tool call arguments.

Changes:
- Remove early done=true when chunk has no tool_calls
- Accept any finish_reason (not just 'tool_calls') to mark completion

Signed-off-by: rabi <[email protected]>
@michaelneale michaelneale self-assigned this Jan 4, 2026
Copy link
Collaborator

@michaelneale michaelneale left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems good - tested it out.

@michaelneale michaelneale merged commit 4aa6a17 into block:main Jan 5, 2026
17 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