fix(translator): preserve additionalProperties: true for Gemini schemas (#12509) - #12768
fix(translator): preserve additionalProperties: true for Gemini schemas (#12509)#12768KooshaPari wants to merge 1 commit into
Conversation
…as (diegosouzapw#12509) Gemini API function_declarations rejects additionalProperties: false with HTTP 400 'Unknown name', but *accepts* (and honors) additionalProperties: true - strict-by-default validation on top of the explicit properties list. The current normalizeAdditionalProperties() unconditionally deletes the key regardless of value. That means a tool author who explicitly opts into strict validation gets the opposite of what they asked for (Gemini's default-permissive behavior, not strict). Strip only when value === false, preserve true. Fixes diegosouzapw#12509
|
Thanks for digging into #12509 — but I have to close this one, because the diff argues against itself. The change narrows the strip to
That is the exact failure #1421 removed. Gemini If the goal is to stop silently discarding caller intent, the place for that is a translator-level warning or a Reopening is welcome if you have an upstream response showing Gemini now accepts |
Summary
Fixes #12509
Gemini API `function_declarations` rejects `additionalProperties: false` with HTTP 400 "Unknown name", but accepts (and honors) `additionalProperties: true` — strict-by-default validation on top of the explicit properties list, exactly the case where the caller wants Gemini to error on unknown input.
The current `normalizeAdditionalProperties()` in `open-sse/translator/helpers/geminiHelper.ts` unconditionally deletes the key regardless of value — so a tool author who explicitly opts into strict validation gets the opposite of what they asked for.
Fix
```diff
delete record.additionalProperties;
}
```
Fixes #12509