Copilot answered 400 to an MCP tool schema with an array-level enum, a root
oneOf or anyOf, prefixItems, an anyOf beside its own type, or an object
without properties at the root. copilotGeminiToolShapes (after
copilotGeminiToolUnions) writes each as the nearest schema it takes:
properties {} added; same-type anyOf merged (null kept as anyOf with null);
an anyOf with an untyped branch dropped, so geminiTypes types the node;
array enum moved to string items or dropped; root union an object with the
branches' properties, none required; prefixItems / items-as-list one items
schema. Nested oneOf and fit schemas go byte for byte. Antigravity's
plainSchema had the same array-level enum and now moves it to items. A
same-type object anyOf that wasn't provably disjoint is now merged instead
of refused (TestCopilotGeminiKeepsUnprovenUnions uses mixed types now).
Real Copilot account, sandbox magpie (own HOME, only the copilot login),
gemini-3.8-flash and gemini-4-argon, build without the pass -> with it:
array enum 400->200, root oneOf 400->200, prefixItems 400->200, root anyOf
(strings, objects, untyped) 400->200, anyOf beside type 400->200, root
{"type":"object"} 400->200, fit control 200->200. Nested object-without-
properties and nested typeless same-type anyOf were already 200 on the old
build, so the reports' failing forms are the root and type-beside ones.
Run: new TestCopilotGeminiTakesToolShapes (8 rows, red on the old code with
the call unwired), TestCopilotGeminiToolShapesLeavesFitSchemas,
TestAntigravitySchemaArrayEnumMovesToItems, -run Copilot|Antigravity|Schema
on internal/gateway ok (mote); vet darwin, windows, linux nogui ok.
Not tried: the full gateway and provider package run (mote busy, still
going when tagged); Google AI, Vertex and Antigravity with real accounts;
the GUI suite (no GUI file touched).