Description
When OpenCode Go is configured as an OpenAI-compatible custom provider in Codex (ChatGPT Desktop), requests that include the built-in automation_update function fail during tool-schema validation, before model inference starts.
The emitted function.parameters is a JSON Schema with a root-level $defs and oneOf. Every branch is an object schema, but the parameters schema itself has no top-level type. OpenCode Go / Console Go rejects this shape and requires tools[].function.parameters.type to be "object".
Steps to Reproduce
- Configure
https://opencode.ai/zen/go/v1 as an OpenAI-compatible custom provider in Codex / ChatGPT Desktop.
- Send a non-streaming chat completion request to
/v1/chat/completions using deepseek-v4-flash and the following tool schema.
- Use an OpenCode Go API key in the
Authorization header.
export OPENCODE_GO_API_KEY='REDACTED'
curl -sS https://opencode.ai/zen/go/v1/chat/completions \
-H "Authorization: Bearer ${OPENCODE_GO_API_KEY}" \
-H 'Content-Type: application/json' \
--data-binary @request.json
request.json:
{
"model": "deepseek-v4-flash",
"messages": [
{"role": "user", "content": "schema compatibility probe"}
],
"stream": false,
"tool_choice": "auto",
"tools": [
{
"type": "function",
"function": {
"name": "automation_update",
"description": "Create, update, view, or delete recurring automations.",
"parameters": {
"$defs": {
"stringValue": {"type": "string"}
},
"oneOf": [
{
"type": "object",
"additionalProperties": false,
"properties": {
"mode": {"type": "string", "enum": ["view"]},
"id": {"$ref": "#/$defs/stringValue"}
},
"required": ["mode", "id"]
},
{
"type": "object",
"additionalProperties": false,
"properties": {
"mode": {"type": "string", "enum": ["delete"]},
"id": {"$ref": "#/$defs/stringValue"}
},
"required": ["mode", "id"]
}
]
}
}
}
]
}
Expected Behavior
The provider should accept a root-level oneOf when its branches are object schemas, or document the supported subset and provide a compatible normalization path.
Actual Behavior
The request is rejected with HTTP 400 before inference:
Error from provider (Console Go): Upstream request failed:
[invalid_request_error] Invalid schema for function 'automation_update':
schema must be a JSON Schema of 'type: "object"', got 'type: null'.
Adding only this property to function.parameters:
made the same minimal request return HTTP 200 for both deepseek-v4-flash and kimi-k3.
Environment
- Client: Codex / ChatGPT Desktop
- Provider: OpenCode Go
- Endpoint:
https://opencode.ai/zen/go/v1/chat/completions
- Models tested:
deepseek-v4-flash, kimi-k3
- Protocol: OpenAI-compatible Chat Completions
Additional Context
The full automation_update schema emitted by Codex has the same root shape ($defs plus oneOf) as the reduced reproduction above. The failure is independent of thinking/reasoning settings and occurs during tool-schema validation, before model inference.
Description
When OpenCode Go is configured as an OpenAI-compatible custom provider in Codex (ChatGPT Desktop), requests that include the built-in
automation_updatefunction fail during tool-schema validation, before model inference starts.The emitted
function.parametersis a JSON Schema with a root-level$defsandoneOf. Every branch is an object schema, but the parameters schema itself has no top-leveltype. OpenCode Go / Console Go rejects this shape and requirestools[].function.parameters.typeto be"object".Steps to Reproduce
https://opencode.ai/zen/go/v1as an OpenAI-compatible custom provider in Codex / ChatGPT Desktop./v1/chat/completionsusingdeepseek-v4-flashand the following tool schema.Authorizationheader.request.json:{ "model": "deepseek-v4-flash", "messages": [ {"role": "user", "content": "schema compatibility probe"} ], "stream": false, "tool_choice": "auto", "tools": [ { "type": "function", "function": { "name": "automation_update", "description": "Create, update, view, or delete recurring automations.", "parameters": { "$defs": { "stringValue": {"type": "string"} }, "oneOf": [ { "type": "object", "additionalProperties": false, "properties": { "mode": {"type": "string", "enum": ["view"]}, "id": {"$ref": "#/$defs/stringValue"} }, "required": ["mode", "id"] }, { "type": "object", "additionalProperties": false, "properties": { "mode": {"type": "string", "enum": ["delete"]}, "id": {"$ref": "#/$defs/stringValue"} }, "required": ["mode", "id"] } ] } } } ] }Expected Behavior
The provider should accept a root-level
oneOfwhen its branches are object schemas, or document the supported subset and provide a compatible normalization path.Actual Behavior
The request is rejected with HTTP 400 before inference:
Adding only this property to
function.parameters:made the same minimal request return HTTP 200 for both
deepseek-v4-flashandkimi-k3.Environment
https://opencode.ai/zen/go/v1/chat/completionsdeepseek-v4-flash,kimi-k3Additional Context
The full
automation_updateschema emitted by Codex has the same root shape ($defsplusoneOf) as the reduced reproduction above. The failure is independent of thinking/reasoning settings and occurs during tool-schema validation, before model inference.