You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Bug: Provider API z-ai/glm-5.3-flash returns 400 Invalid input (messages.12.content) #795
Calling Command Code GOAT Provider API with z-ai/glm-5.3-flash fails immediately with HTTP 400 after a Codex client sends image-bearing tool outputs.
This is not a timeout and not quota exhaustion. The request is translated from Codex /v1/responses to Command Code /v1/chat/completions, then rejected.
Expected Behavior
Either:
the image tool outputs are accepted and the model continues, or
the API returns a clear, documented error that image parts are not allowed in tool/function output.
Use Codex Desktop against Command Code Provider API via an OpenAI-compatible proxy.
Select z-ai/glm-5.3-flash (client alias glm-5.3-flash-goat).
Ask Codex to inspect 3 local PNG files with view_image in parallel.
Continue the same turn / send the next model request that includes those tool outputs in history.
Command Code Version
0.0.1
Operating System
Windows
Terminal/IDE
codex
Shell
No response
Session file (optional)
No response
Fix prompt (optional)
No response
Additional context
Does z-ai/glm-5.3-flash accept image arrays inside tool/function outputs?
If not, what is the supported image format for Provider API when the client is Codex-style /v1/responses?
Is this a GLM upstream limit, or a /v1/responses → /v1/chat/completions conversion/schema issue in the gateway?
If tool output must be a plain string in Chat Completions, should the documented guidance be: convert input_image tool results to text such as [3 images viewed], or move images into a user message image_url part?
Confirming the root cause with a minimal reproduction — and it is not a GLM upstream limit.
The rule: on /provider/v1/chat/completions, a message with role: "tool" must have content that is a string, or an array of {type:"text"} parts. Anything else returns exactly this error.
Verified by direct API calls against deepseek/deepseek-v4.1-flash, z-ai/glm-5.3-flash and deepseek/deepseek-v4-flash-vision-exp:
content shape
result
"text" / ""
200
[{type:"text", ...}] in any role
200
[{type:"image_url", ...}] in a user message
200
[{type:"image_url", ...}] in a tool message
400 messages.N.content
[{type:"input_text", ...}] in any role
400 messages.N.content
[{type:"output_text", ...}] in an assistant message
400 messages.N.content
[] on a user message
400 — "Too small: expected array to have >=1 items"
Images are accepted in user messages on every model I tried, so this is a content-schema rule on the gateway, not a model capability limit.
Answering the questions in the report: the supported pattern is your second option — move image parts out of the tool result and into a following user message. That is also the shape Command Code's own CLI sends.
Why Codex-style clients keep hitting this: Codex emits function_call_output.output as a content-part array, and Responses API part names (input_text / output_text) leak into the Chat translation. Both are rejected. Every Responses→Chat shim has to rewrite or relocate them, and most do not.
Accepting — or silently dropping — non-text parts inside role:"tool" would clear this whole class of interop bugs immediately, without waiting for the Responses endpoint (#804 / #832).
Activity
Jovan1666 commentedon Sep 13, 2026
Confirming the root cause with a minimal reproduction — and it is not a GLM upstream limit.
The rule: on
/provider/v1/chat/completions, a message withrole: "tool"must have content that is a string, or an array of{type:"text"}parts. Anything else returns exactly this error.Verified by direct API calls against
deepseek/deepseek-v4.1-flash,z-ai/glm-5.3-flashanddeepseek/deepseek-v4-flash-vision-exp:"text"/""[{type:"text", ...}]in any role[{type:"image_url", ...}]in a user message[{type:"image_url", ...}]in a tool messagemessages.N.content[{type:"input_text", ...}]in any rolemessages.N.content[{type:"output_text", ...}]in an assistant messagemessages.N.content[]on a user message"Too small: expected array to have >=1 items"Images are accepted in
usermessages on every model I tried, so this is a content-schema rule on the gateway, not a model capability limit.Answering the questions in the report: the supported pattern is your second option — move image parts out of the tool result and into a following
usermessage. That is also the shape Command Code's own CLI sends.Why Codex-style clients keep hitting this: Codex emits
function_call_output.outputas a content-part array, and Responses API part names (input_text/output_text) leak into the Chat translation. Both are rejected. Every Responses→Chat shim has to rewrite or relocate them, and most do not.Accepting — or silently dropping — non-text parts inside
role:"tool"would clear this whole class of interop bugs immediately, without waiting for the Responses endpoint (#804 / #832).ahmadbilaldev commentedon Sep 16, 2026
should be fixed now folks.