Files
CLIProxyAPI/internal/util
sususu 3904c40d65 fix(antigravity): strip propertyNames inside a property named "properties"
A Claude Messages request carrying MCP-style tool schemas failed before
inference when routed to Antigravity/Gemini: the private backend parses
function declarations as a limited proto-JSON Schema and rejects unknown
fields, so `propertyNames` produced

  Unknown name "propertyNames" at
  'request.tools[0].function_declarations[0].parameters.properties[0].value'

The cleaner already lists `propertyNames` as unsupported, but every
cleaning pass is skipped for nodes classified as property maps, and that
classification matched any path ending in ".properties". A tool may
declare a property named "properties" — Notion's page tools do — and the
schema for that property then sits at ".properties.properties", so it was
mistaken for a property map and nothing inside it was cleaned. The 400
above points at exactly that node.

Replace the suffix match with a parity check over the trailing run of
name-map keywords: the node a keyword names is a map only when its own
parent is a schema, so "properties" is a map, "properties.properties" is
the schema of a property named "properties", and a third repetition is a
map again. Only the trailing run is inspected, so a schema nested under
any prefix by the caller is classified the same way.

Codex/OpenAI egress is untouched: it converts input_schema separately,
uses non-strict tool mode, and accepts this shape.
2026-08-03 16:09:22 +08:00
..
2026-05-10 02:33:42 +08:00