Repository navigation
Conversation
3ea5fe1 to
a596e55
Compare
Adapt upstream PR cheaper-inference#13059 to the existing v3.8.48 sanitizer phases. Preserve tool arguments and response-schema fields while retaining actual constraint cleanup. Add regression coverage for OpenAI and Anthropic request translation and record upstream maintenance decisions. Co-Authored-By: zcrew0x <zcrew0x@users.noreply.github.com> Co-Authored-By: GPT-6 <noreply@openai.com>
|
@zcrew0x target release/v3.8.51 please |
a596e55 to
8e98197
Compare
|
@ekinnee Rebased onto |
Verified against the exact #13477 Stage payloadThis PR also fixes the concrete Antigravity/Gemini 400 reported in #13477. I replayed the exact captured Stage request shape locally through
On current {
"type": "object",
"properties": {
"enabled": { "type": "boolean" },
"notify": { "type": "boolean" },
"required": { "type": "boolean" },
"type": "object"
},
"required": ["enabled"]
}The last entry is the bug: At this PR's head ( {
"type": "object",
"properties": {
"enabled": { "type": "boolean" },
"notify": { "type": "boolean" },
"required": { "type": "boolean" }
},
"required": ["enabled"]
}No phantom So #13477 is not a separate converter problem in this reproduced case; it is another real-world manifestation of #13057's unsafe schema-map traversal. Please consider adding |
8e98197 to
4694ef6
Compare
|
@sprintberlin Thank you for reproducing and validating against the #13477 stage payload! I have added the |
…-09-15) (#13731) Second `npm run release:reconcile` pass on `release/v3.8.50..release/v3.8.51` (0915890..c0f92ec, 916 non-merge commits, 877 merged PRs): - fold the 173 changelog.d fragments accumulated since #12971 under `## [3.8.51]` and delete them - generate bullets for the 58 cycle commits that had no fragment (4 features / 42 fixes / 12 maintenance), each with the merged PR link and `— thanks @author` - link 137 fragment bullets to the PR of the commit that added them and credit the author; two prefix/origin mismatches reviewed (#12945→#13392, #13001→#13379, both maintainer rebaselines of other people's PRs) - refresh "Release by the numbers" + Top-25 and regenerate the `### 🙌 Contributors` hall (112 external contributors + maintainer; every non-bot author of the 877 merged PRs present) - closed-PR credit audit for the window: nothing to add (#13215→#13361 and #13059→#13690 are still open, #12998 was independently fixed earlier by #12853); no human co-author trailers, no commits without a PR - resync the 58 i18n CHANGELOG mirrors Gates: check:changelog-integrity OK, check:docs-sync PASS.
…-09-15) (cheaper-inference#13731) Second `npm run release:reconcile` pass on `release/v3.8.50..release/v3.8.51` (104d4f8..d61b804, 916 non-merge commits, 877 merged PRs): - fold the 173 changelog.d fragments accumulated since cheaper-inference#12971 under `## [3.8.51]` and delete them - generate bullets for the 58 cycle commits that had no fragment (4 features / 42 fixes / 12 maintenance), each with the merged PR link and `— thanks @author` - link 137 fragment bullets to the PR of the commit that added them and credit the author; two prefix/origin mismatches reviewed (cheaper-inference#12945→cheaper-inference#13392, cheaper-inference#13001→cheaper-inference#13379, both maintainer rebaselines of other people's PRs) - refresh "Release by the numbers" + Top-25 and regenerate the `### 🙌 Contributors` hall (112 external contributors + maintainer; every non-bot author of the 877 merged PRs present) - closed-PR credit audit for the window: nothing to add (cheaper-inference#13215→cheaper-inference#13361 and cheaper-inference#13059→cheaper-inference#13690 are still open, cheaper-inference#12998 was independently fixed earlier by cheaper-inference#12853); no human co-author trailers, no commits without a PR - resync the 58 i18n CHANGELOG mirrors Gates: check:changelog-integrity OK, check:docs-sync PASS.
Fixes #13057
Closes #13477
Problem
When a tool parameter schema contains a property named
"properties","required", etc. (e.g. in Roblox Studio, Blender, JSON Patch, ordelivery.pin):{ "type": "object", "properties": { "action": { "type": "string" }, "properties": { "type": "array", "items": { "type": "string" } } }, "required": ["action"] }Schema visitor functions in
open-sse/translator/helpers/geminiHelper.ts(such asinjectObjectType,addPlaceholders,cleanupRequired, etc.) traversed schemas by doing a blindfor (const value of Object.values(record)). When visitingschema.properties, becauserecord.typewasundefinedandrecord.properties(orrecord.required) existed,injectObjectTypeinjectedschema.properties.type = "object"directly into the property dictionary.This corrupted the schema sent to Google CloudCode/Gemini:
{ "type": "object", "properties": { "action": { "type": "string" }, "properties": { "type": "array", "items": { "type": "string" } }, "type": "object" <-- Invalid schema property } }Google rejected the request with HTTP 400:
Solution
forEachSubschemaingeminiHelper.tsto traverse subschemas according to JSON Schema structure (descending into values ofproperties,patternProperties,$defs,definitionsrather than treating the container maps as schema nodes).forEachSubschemaacross all schema visitors ingeminiHelper.ts(injectObjectType,addPlaceholders,cleanupRequired,normalizeAdditionalProperties,convertConstToEnum,convertEnumValuesToStrings,mergeAllOf,flattenAnyOfOneOf, andflattenTypeArrays).tests/unit/gemini-schema-properties-name-collision-13057.test.tscovering both property named"properties"(fix(providers): Gemini schema sanitizer corrupts tools containing property named 'properties' (HTTP 400) & keepalive chunk desync in AI-SDK #13057) and property named"required"([BUG] Antigravity (AGY) Provider Returns 400 Bad Request - Schema Incompatibility with Google Gemini Tools #13477).