Skip to content

Preserve partial tool call accumulator state on aborted response streams (fix #3561) - #2

Open
SparshGarg999 wants to merge 1 commit into
mainfrom
fix-response-stream-abort-tool-call-3561
Open

SparshGarg999 wants to merge 1 commit into
mainfrom
fix-response-stream-abort-tool-call-3561

Conversation

@SparshGarg999

Copy link
Copy Markdown
Owner

Fixes openai#3561

Summary

When aborting a streaming Responses API request mid-tool call, partial function_call event state was previously discarded during stream finalization. This resulted in missing tool call history on subsequent conversation turns, throwing 400 "No tool call found for function call output".

This PR updates _streaming.py to flush partial function_call accumulator state into stream history upon abort, ensuring consistent tool call tracking across turns.

How was this tested?

  • Tested stream abort event handling for tool calls in _streaming.py.

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.

Aborting a streaming Responses API request drops the function_call item, breaking the next turn with 400 "No tool call found for function call output"

1 participant