fix: omit thinking field for GLM-5.3 / GLM-5.3-Flash - #130
Merged
Merged
Conversation
GLM-5.3 and GLM-5.3-Flash always think and their upstream route rejects the Chat Completions thinking field outright (HTTP 400 'json: unknown field "thinking"'), so every request to these models failed. Thinking strength is controlled only through reasoning_effort (low/high/max). - Add a supportsThinkingParam model capability (default true) and wire it through ModelMeta, ModelMetaOverride and OpenCodeGoModelItem. - Omit the thinking field in the OpenAI/Anthropic adapters and in both vision-proxy request builders when the route rejects it. - Mark glm-5.3 / glm-5.3-flash as thinkingMode "always" + supportsThinkingParam false so the picker no longer offers an off switch the endpoint cannot honour. - Add scripts/test-thinking-param.mjs regression coverage and sync architecture/reference/build docs. Fixes #129
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.
Changes
1. New model capability:
supportsThinkingParamsupportsThinkingParam(defaulttrue) toModelMeta,ModelMetaOverrideandOpenCodeGoModelItem, wired through the catalog merge chain andgetCatalogModelConfig().false, the OpenAI Chat and Anthropic adapters omit the top-levelthinkingfield entirely, andbuildReasoningEnum()stops offering the "禁用思考" option since no request may disable thinking.provider.ts.2. GLM-5.3 / GLM-5.3-Flash overrides
glm-5.3andglm-5.3-flashasthinkingMode: "always"+supportsThinkingParam: falseinMODEL_OVERRIDES.thinkingfield with400 json: unknown field "thinking"(issue 400 Error when using GLM5.3 flash #129); requests now carry onlyreasoning_effort(low/high/max) to control thinking strength, which matches the vendor migration guidance ("off" maps to the lowest tier).3. Regression coverage and docs
scripts/test-thinking-param.mjscovering the omitted field (OpenAI + Anthropic adapters), the retainedreasoning_effort, and the picker no longer exposing "禁用思考" whileglm-5.2keeps it.npm testand synceddocs/architecture.md,docs/reference.mdanddocs/build.md.Files Changed
src/modelOverrides.tssupportsThinkingParamoverride field and the GLM-5.3 / GLM-5.3-Flash entries.src/catalogModels.tsModelMetaand hid the unsupported off switch in the reasoning enum.src/openai/openaiApi.tsthinkingfield when the route rejects it.src/anthropic/anthropicApi.tssrc/provider.tssrc/types.tssupportsThinkingParamto the model config interface.scripts/test-thinking-param.mjspackage.jsonnpm test.docs/architecture.md,docs/reference.md,docs/build.md