#314·gpt-oss

Responses API silently fabricates missing function call IDs as call_1234

Author: julianvanceblackwoodCreated Sep 24, 2026Updated Sep 24, 2026

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:

python
class FunctionCallItem(BaseModel):
    ...
    call_id: str = "call_1234"

class FunctionCallOutputItem(BaseModel):
    ...
    call_id: str = "call_1234"

For example:

json
{
  "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:

python
call_id: str

Internal model-generated calls already pass explicit UUID-backed call IDs.

Regression coverage should verify:

  1. missing function-call call_id returns HTTP 422;
  2. missing function-call-output call_id returns HTTP 422;
  3. multiple missing IDs cannot become a shared synthetic binding;
  4. 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.