fix: default loose function tools to strict:false in Responses API conversion

Loose Chat Completions / MCP / OpenAPI-derived function tools carry no
tool-level strict flag, so convert_to_responses_payload() sent them to
/v1/responses with strict omitted. The Responses API then materializes
every optional property and can populate mutually-exclusive filters,
which get forwarded to the tool unchanged and can be rejected. Default
the converted tool to strict:false, preserving an explicit strict from
the source tool.

Closes #27750
This commit is contained in:
Shawn 2026-08-02 09:14:29 -04:00
parent 52145eede9
commit 109aa6f386
No known key found for this signature in database

View file

@ -1141,8 +1141,8 @@ def convert_to_responses_payload(payload: dict) -> dict:
converted_tool['description'] = func['description']
if 'parameters' in func:
converted_tool['parameters'] = func['parameters']
if 'strict' in func:
converted_tool['strict'] = func['strict']
# Default loose tools to non-strict; preserve explicit strict.
converted_tool['strict'] = func.get('strict', False)
converted_tools.append(converted_tool)
else:
# Already in correct format or unknown format, pass through