Commit Graph

5 Commits

Author SHA1 Message Date
Peter Steinberger
54d82b3055 fix(mcp): normalize invalid object tool properties 2026-05-02 09:48:32 +01:00
Ayaan Zaidi
3f766c8c62 fix: normalize MCP empty tool schemas (#75401) (thanks @SymbolStar) 2026-05-02 09:14:57 +05:30
jindongfu
1890d96680 fix(mcp): normalize empty parameter-free tool schema before sending to OpenAI (#75362)
MCP servers may return inputSchema as { type: "object" } without a
properties field, or with properties set to undefined/null. The
hasTopLevelObjectSchema guard only checked 'properties' in schemaRecord
(key existence) without verifying the value is a real object. This caused
such schemas to pass through unnormalized, resulting in OpenAI rejecting
them with 'object schema missing properties'.

Fix: tighten hasTopLevelObjectSchema to require properties to be a
non-null object, and broaden isTypedSchemaMissingProperties to catch
properties keys with undefined/null values.

Regression of #60158 (originally fixed by #60176).
2026-05-02 09:14:57 +05:30
Peter Steinberger
33aea44fe5 refactor: tighten tool schema types 2026-04-23 05:06:58 +01:00
Peter Steinberger
b4f12bb4c3 perf(test): slim OpenAI and Pi runner imports 2026-04-20 12:26:30 +01:00