Skip to content

Conversation

habema
Copy link
Contributor

@habema habema commented Sep 2, 2025

Problem

#1300 introduced immediate tool_called event emission during streaming, but it was emitting events on ResponseOutputItemAddedEvent which has empty arguments instead of ResponseOutputItemDoneEvent which has complete arguments.

The fix

Simple one-line change:

# Before (broken)
if isinstance(event, ResponseOutputItemAddedEvent):

# After (fixed) 
if isinstance(event, ResponseOutputItemDoneEvent):

Now tool calls are emitted when they're complete with full arguments instead of when they start with empty arguments.

New tests

  • Comprehensive regression tests to make sure this doesn't happen again.

Fixes #1629

@seratch seratch added bug Something isn't working feature:core labels Sep 2, 2025
@seratch seratch changed the title Fix Empty tool call arguments in streaming events Fix #1629 Empty tool call arguments in streaming events Sep 2, 2025
Copy link
Member

@seratch seratch left a comment

Choose a reason for hiding this comment

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

Thanks for quickly addressing this issue!

@seratch seratch merged commit a9bdf8e into openai:main Sep 2, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working feature:core
Projects
None yet
Development

Successfully merging this pull request may close these issues.

arguments in tool_called streaming event with 0.2.10
2 participants