Confirm this is an issue with the Python library and not an underlying OpenAI 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):
{
"type": "response.function_call_arguments.done",
"arguments": "{...}",
"item_id": "fc_0e7fa7b0f70886a0006a4a7f734bd881929f7d0eae45f46f97",
"output_index": 2,
"sequence_number": 10
}
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:
from openai.types.responses import ResponseFunctionCallArgumentsDoneEvent
ResponseFunctionCallArgumentsDoneEvent.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)
Confirm this is an issue with the Python library and not an underlying OpenAI API
Describe the bug
ResponseFunctionCallArgumentsDoneEventdeclaresname: stras required (both in v2.38.0 and in the current generated model onmain), but the live Responses API's streamedresponse.function_call_arguments.doneevents do not include anamekey.Observed payload from a streamed
responses.createcall with function tools (gpt-5.4):{ "type": "response.function_call_arguments.done", "arguments": "{...}", "item_id": "fc_0e7fa7b0f70886a0006a4a7f734bd881929f7d0eae45f46f97", "output_index": 2, "sequence_number": 10 }Strict validation of the
ResponseStreamEventunion therefore fails on every such event withmissing: 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 withnameunset — but:event.nameon these events is silentlyNonedespite the type declaringstr, so type-checked user code reading it is misled.Since the current
mainmodel (Stainless-generated) still requiresname, this looks like drift between the OpenAPI spec and the live API rather than a stale pin — either the API should emitnameonresponse.function_call_arguments.done(it's genuinely useful; today one must correlate viaitem_idback to theoutput_item.addedevent to know which function completed), or the model field should beOptional[str].For prior art on this bug class: #2311 (a mis-mapped streaming event type, since fixed).
To Reproduce
client.responses.create(stream=True, tools=[...])with a prompt that triggers a function call (observed ongpt-5.4).ResponseStreamEvent(or run any pydantic validation instrumentation).response.function_call_arguments.doneevent fails strict validation withmissing: nameforResponseFunctionCallArgumentsDoneEvent.Code snippets
OS
Linux (Docker)
Python version
Python 3.14.0
Library version
openai 2.38.0 (model on current main also declares
name: strrequired)