The third round of #3392, after the reporter merged the system-turn fix:
codex went through, but every Claude call still 400ed — xAI answers
'Invalid request content: Schema validation failed: [standard_violation]
/required: null is not of type "array"'. A tool's schema said
"required": null where none were (Claude Code's own tools, an MCP
server's among them; Anthropic's API takes the null, xAI validates each
schema as a JSON Schema). The relay forwarded it as sent.
The key now goes wherever a tool schema leaves magpie for api.x.ai —
input_schema (Anthropic), parameters (Responses) and function's
parameters (the translated path), at the schema's root or nested; a real
array of names stays as it came, and a body with no null required keeps
its bytes.
Replayed on a fake xAI by the reporter's wording: the claude call with a
root and a nested null required goes through, Bash's real array and the
schemas' contents beside them as they were; with the shaper off, both
new tests go red. Full nogui gateway package: the four reds
(TestClaudeClientCacheAbsentUnchanged, TestCodexFittedImagesPastTheBudget,
TestMarshalRawIsEncodingJSON, FuzzMarshalRaw) match a clean-baseline run
of the same branch in the same session; a fifth clean-baseline red
(TestHandedOverGatewayFinishesItsStream, the known flake) passed here.
gofmt / go vet clean, linux/windows/darwin nogui builds pass. Not tried
against the real xAI API: no key here.
From skygunner's branch fix/issue-batch-1024pm; kongkongklng confirmed it on 10-25.