b78ff50d8d
Port from Kilo-Org/kilocode#11955: Gemini validates every object schema's required list strictly against the same node's properties and fails the ENTIRE GenerateContentRequest with HTTP 400 'required[0]: property is not defined' when a name has no matching property. MCP servers (e.g. the GitHub remote MCP) routinely emit array item schemas carrying required without properties, which made every request on the native Gemini path fail before any model output. sanitize_gemini_schema() now filters required to names present in the node's properties and drops the keyword when nothing valid remains. Applies recursively (properties / items / anyOf). Tool handlers still validate required fields at execution time, so nothing the model could actually use is lost. Scoped to the Gemini-facing sanitizer only — the universal tools/schema_sanitizer.py already prunes typed object nodes, and its remaining gap (untyped nodes) is contested by open PR #20151.