Repository navigation
Description
Description
The OpenCode Zen x-preview-f-free route returns the string "null" for a
tool argument declared as string | null. The same request to
nemotron-3-ultra-free returns JSON null.
Ox Alpha response:
{"nullableValue":"null"}Nemotron response:
{"nullableValue":null}The wrong type is present in the raw
choices[0].message.tool_calls[0].function.arguments response from Zen, before
an OpenCode client or AI SDK parses it.
I also tested strict: true, anyOf, oneOf, reversed union order, and
OpenAPI-style nullable: true. Ox Alpha returned the string "null" in every
case. It returned JSON null for a null-only schema and for unions of null with
integer, boolean, number, object, or array. The failure appears specific to
nullable strings on this route.
This breaks any tool that uses null as the no-value form for a string field,
including paths and object IDs.
Plugins
None. The reproduction calls the public Zen endpoint directly.
OpenCode version
The client integration uses OpenCode 1.18.16. The minimal reproduction below
does not use the client.
Steps to reproduce
Run this keyless request:
curl -sS https://opencode.ai/zen/v1/chat/completions \
-H 'Authorization: Bearer public' \
-H 'Content-Type: application/json' \
--data-binary '{
"model": "x-preview-f-free",
"messages": [{
"role": "user",
"content": "Call probe_tool exactly once. nullableValue is JSON null. Preserve JSON types."
}],
"tools": [{
"type": "function",
"function": {
"name": "probe_tool",
"description": "Schema compatibility probe",
"parameters": {
"type": "object",
"properties": {
"nullableValue": {
"type": ["string", "null"]
}
},
"required": ["nullableValue"],
"additionalProperties": false
}
}
}],
"tool_choice": {
"type": "function",
"function": {"name": "probe_tool"}
},
"stream": false
}' | jq -r '.choices[0].message.tool_calls[0].function.arguments'Observed:
{"nullableValue":"null"}Change only model to nemotron-3-ultra-free. The result is:
{"nullableValue":null}A client compatibility lowering works on Ox Alpha: advertise the field as an
optional string and decode omission back to null. In two no-value probes, Ox
Alpha returned {}. When given a string, it returned
{"nullableValue":"abc123"}.
Screenshot and/or share link
None.
Operating System
macOS
Terminal
zsh
Activity
thdxr commentedon Oct 11, 2026
Thanks for the report! OpenCode 2.0 is now out and development is focused on V2, so we're closing issues filed against OpenCode 1. Please upgrade (
opencode upgrade --major, details: https://anoma.ly/notes/opencode-2-0), and if this is still relevant on 2.0, reopen this issue or open a new one with your 2.0 version.— from 𝕺𝖕𝖊𝖓𝕮𝖔𝖉𝖊