Repository navigation
fix(glm): one Mac serves a JSON response_format with image or video input - #2006
Closed
jonathan308 wants to merge 2 commits into
Closed
jonathan308 wants to merge 2 commits into
jonathan308 wants to merge 2 commits into
Conversation
…input (red) A GLM-5.3-Flash Mac refuses every request that combines an image or video with a JSON response_format: "GLM5: JSON response_format is not supported with image or video input" (400 invalid_request). On 11-11 an OpenRouter extraction client sent ~11.4k such requests (json_object 11,109, json_schema 287) and got 99.6 % 400s. The refusal came with JSON mode (2d65e06, #1561), as scoping: GLM's JSON answer is not constrained decoding (the native engine refuses sampler constraints), it is the service's instruction plus a withheld, validated answer, and only the text path routed reasoning to the typed channel and recorded withheld output. Nothing in the media prefill (vision spans, MTP) depends on the format. Red here, green on the next commit: - GLM5NextMediaRoutingTests: image + json_object and image + json_schema on one Mac stream the reasoning on its typed channel, withhold the answer and expose it once validated, and record the withheld output for the pre-content interval; an answer that is not the JSON asked for is the same typed 422 as on text, with no content. - GLMSlotParityTests (through the OpenAI service, so the instruction turn is rendered): image + json_schema and image + json_object answer on one Mac. Guards that pass here and must keep passing: required/named tool_choice with media stays refused with its message, and the cluster pair keeps refusing JSON with media with the same 400 before any media work. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…nput GLM-5.3-Flash refused every JSON response_format with image or video input with 400 invalid_request, before any media work. The refusal was scoping from when JSON mode landed (2d65e06, #1561), not a limit of the model or engine: GLM's JSON answer is not constrained decoding (the native engine refuses sampler constraints, so no grammar meets the vision spans and MTP drafting is unchanged); it is the service's instruction turn plus an answer withheld and validated after generation (GLM5NextResponseFormat). The media prompt already renders the instruction turn (glm5NextUserInput normalizes the same prepared request), and the shared event stream already builds the withheld answer from the prepared format. Only two wires were missing on the media branch: - reasoning is routed to the typed native channel when the output is withheld (as the text path does), so only the answer is withheld and validated, never the reasoning or its markers; - the withheld answer is recorded on the usage signal, so the relay's pre-content interval and TTFT see the first generated token. Still refused with the same 400 and message, before any media decode: - required/named tool_choice with media, on any slot (only the text path withholds and validates a forced call); - JSON with media on a cluster pair (servesDistributedPair, or either pair media route): prepareClusterGLMMedia and prepareClusterGLMImage withhold neither, the image route refuses JSON outright, and no GPU run has covered a pair with this shape. withholdsGLMOutput is now named once at the top of prepareCompletion and read by the refusal, the media branch and the text path. Docs: inference.md (GLM JSON and the slot-parity rule), cli-reference (unsupported response format); changelog fragment. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Collaborator
Author
|
Superseded by #2009. |
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Superseded by #2009.