Responses API silently fabricates missing function call IDs as call_1234
Summary
The local Responses API assigns the same placeholder call_id, call_1234, when function-call identity is omitted.
This turns malformed tool history into a valid-looking synthetic binding before the request reaches function_call_map.
Current behavior
gpt_oss/responses_api/types.py defines:
class FunctionCallItem(BaseModel):
...
call_id: str = "call_1234"
class FunctionCallOutputItem(BaseModel):
...
call_id: str = "call_1234"For example:
{
"model": "gpt-oss-120b",
"input": [
{"type": "function_call", "name": "get_weather", "arguments": "{}"},
{"type": "function_call", "name": "delete_file", "arguments": "{}"},
{"type": "function_call_output", "output": "21C sunny"}
]
}All three items are normalized to the same call_id. The second call overwrites the first entry in function_call_map, so the output can be attributed to the wrong function.
Binding invariant
The current OpenAI Python ResponseFunctionToolCallParam requires call_id for function-call input.
Newer function-call output input shapes can expose additional association fields, but this local FunctionCallOutputItem contains only call_id and output. In the local server, call_id is therefore the only key used to bind an output to its originating function call.
The server should reject a missing binding identity rather than create one.
Proposed fix
Make call_id required in both local models:
call_id: strInternal model-generated calls already pass explicit UUID-backed call IDs.
Regression coverage should verify:
- missing function-call
call_idreturns HTTP 422; - missing function-call-output
call_idreturns HTTP 422; - multiple missing IDs cannot become a shared synthetic binding;
- explicit matching call/output IDs continue to work.
This is complementary to #308 and #309. Those address explicit duplicate IDs at the binding layer. This issue addresses synthetic duplicates created during request validation.
Source: openai/gpt-oss