You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Confirm this is an issue with the Python library and not an underlying OpenAI API
This is an issue with the Python library (or spec drift between the SDK models and the live API)
Describe the bug
ResponseFunctionCallArgumentsDoneEvent declares name: str as required (both in v2.38.0 and in the current generated model on main), but the live Responses API's streamed response.function_call_arguments.done events do not include a name key.
Observed payload from a streamed responses.create call with function tools (gpt-5.4):
Strict validation of the ResponseStreamEvent union therefore fails on every such event with missing: name (plus the ~100 other enumerated union-member errors). Nothing crashes — construct_type (openai/_models.py:621 → validate_type:843 → _validate_non_model_type:890) tries strict validation inside a try/except and falls back to lenient construction, so the event flows through with name unset — but:
Anyone running pydantic validation instrumentation (e.g. logfire's pydantic plugin) sees a warning with ~101 enumerated errors per function-call round, and
event.name on these events is silently None despite the type declaring str, so type-checked user code reading it is misled.
Since the current main model (Stainless-generated) still requires name, this looks like drift between the OpenAPI spec and the live API rather than a stale pin — either the API should emit name on response.function_call_arguments.done (it's genuinely useful; today one must correlate via item_id back to the output_item.added event to know which function completed), or the model field should be Optional[str].
For prior art on this bug class: #2311 (a mis-mapped streaming event type, since fixed).
To Reproduce
Call client.responses.create(stream=True, tools=[...]) with a prompt that triggers a function call (observed on gpt-5.4).
Validate incoming SSE event dicts strictly against ResponseStreamEvent (or run any pydantic validation instrumentation).
Every response.function_call_arguments.done event fails strict validation with missing: name for ResponseFunctionCallArgumentsDoneEvent.
Code snippets
# The event payload above, validated strictly:fromopenai.types.responsesimportResponseFunctionCallArgumentsDoneEventResponseFunctionCallArgumentsDoneEvent.model_validate({
"type": "response.function_call_arguments.done",
"arguments": "{}",
"item_id": "fc_x",
"output_index": 0,
"sequence_number": 1,
}) # pydantic.ValidationError: name Field required
OS
Linux (Docker)
Python version
Python 3.14.0
Library version
openai 2.38.0 (model on current main also declares name: str required)
From the response.output_item.added event, you store the item_id → name mapping, and then use it for subsequent function_call_arguments.done events. This is a fully API-compatible solution with the current API.
This is fixed on current main by #3801 (2a98f6a1dee448c6410531c89c2de0af4383c6a7), which removed the generated name field from the stable and beta response.function_call_arguments.done event models and correlates the function-call item by item_id where the name is needed.
I re-ran the issue's strict-validation reproduction at current main (be928151): the payload without name now validates successfully as ResponseFunctionCallArgumentsDoneEvent. No release tag currently contains the fixing commit, so this is fixed on main but does not appear to be in a tagged release yet.
Activity
Mahnoor-Zaffar commentedon Jul 6, 2026
Hey, I would love to work on this.
Can you assign me this issue?
Thanks
nomiveritas commentedon Jul 7, 2026
From the response.output_item.added event, you store the item_id → name mapping, and then use it for subsequent function_call_arguments.done events. This is a fully API-compatible solution with the current API.
Add OpenAI Python streaming field test record
Hughhhhcoder commentedon Sep 8, 2026
This is fixed on current
mainby #3801 (2a98f6a1dee448c6410531c89c2de0af4383c6a7), which removed the generatednamefield from the stable and betaresponse.function_call_arguments.doneevent models and correlates the function-call item byitem_idwhere the name is needed.I re-ran the issue's strict-validation reproduction at current
main(be928151): the payload withoutnamenow validates successfully asResponseFunctionCallArgumentsDoneEvent. No release tag currently contains the fixing commit, so this is fixed onmainbut does not appear to be in a tagged release yet.markstuart-oai commentedon Sep 8, 2026
Hi @Hughhhhcoder, this was just released with 3.9.0!
#3796