mirror of
https://github.com/microsoft/vscode.git
synced 2026-08-03 01:13:12 +08:00
The Gemini BYOK function-declaration converter assumed a JSON Schema
`type` was always a single string. When a tool parameter used a nullable
union such as `{ "type": ["string", "null"] }`, the array was stringified
into `"string,null"` and rejected with `Unsupported type: string,null`.
Through the Agent Host this surfaced as an HTTP 502 that the Copilot SDK
retried five times before failing the turn. Because the failure lives in
the shared converter, regular editor BYOK is susceptible to the same
schema shape.
Normalize nullable unions to Gemini's `nullable: true`, map multi-type
unions to `anyOf`, and handle nullable array items and anyOf/oneOf that
contain `null`. Add regression tests for these cases.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>