Skip to content

feat(core): support glm-5.3-flash under glm-v family - #3071

Open
kinsolee wants to merge 2 commits into
web-infra-dev:mainfrom
kinsolee:feat/glm-5.3-flash
Open

feat(core): support glm-5.3-flash under glm-v family#3071
kinsolee wants to merge 2 commits into
web-infra-dev:mainfrom
kinsolee:feat/glm-5.3-flash

Conversation

@kinsolee

Copy link
Copy Markdown

feat(core): support glm-5.3-flash under glm-v family

Summary

GLM-5.3-Flash is an always-thinking vision model: it rejects
thinking.type: 'disabled' with error 1210 ("该模型始终思考,不支持关闭思考"),
so the existing glm-v adapter contract does not fit it.

This PR branches the glm-v chat-completion parameter builder on the resolved
model name:

  • For glm-5.3-flash (matched by /^glm-5\.3-flash\b/):
    • thinking stays enabled with clear_thinking: false
    • depth is steered via reasoning_effort (defaults to low when the user
      disables reasoning, since thinking cannot be turned off)
    • officially recommended sampling defaults: temperature: 1, top_p: 0.95
      (https://docs.bigmodel.cn/cn/guide/models/vlm/glm-5.3-flash)
  • All other glm-v models keep the existing toggleable-thinking contract
    unchanged.

To support the branching, ChatCompletionCallInput /
ChatCompletionCallContext gain an optional modelName, and callAI passes
modelConfig.modelName through.

Changes

  • packages/core/src/ai-model/models/glm.ts — always-thinking branch
  • packages/core/src/ai-model/model-adapter/types.ts — optional modelName
  • packages/core/src/ai-model/service-caller/index.ts — pass modelName
  • packages/core/tests/unit-test/model-adapter/glm.test.ts — new unit tests
  • apps/site/docs/{en,zh}/model-common-config.mdx — list glm-5.3-flash under
    glm-v with an always-thinking note

Verification

Field-tested against the Zhipu (BigModel) Coding Plan endpoint on 2026-08-26
(KSL-49 spike) and re-verified on 2026-08-31 in a production Android-automation
setup driving real devices through agentFromAdbDevice:

  • glm-5.3-flash with the patched parameters returns HTTP 200 and completes
    real aiAct tasks on physical Android devices (e.g. "open the Settings app"
    reliably launches com.android.settings).
  • Same-sample accuracy on par with the production vision models
    (qwen3.8-max / MiniMax-M3); locate IoU 0.698 with the glm-v 0-1000 bbox
    contract on a UI-screenshot benchmark.
  • thinking.type: 'disabled' is confirmed rejected by the endpoint with error
    1210, which is why the adapter keeps thinking enabled for this model.
  • The added unit tests cover both the always-thinking branch and the unchanged
    toggleable-thinking behavior of other glm-v models.

GLM-5.3-Flash is an always-thinking vision model: it rejects
thinking.type=disabled with error 1210, so the glm-v adapter now
branches on the resolved model name. For glm-5.3-flash it keeps
thinking enabled (clear_thinking=false), steers depth via
reasoning_effort (low when the user disables reasoning), and applies
the officially recommended temperature=1 / top_p=0.95 defaults.
Other glm-v models keep the toggleable-thinking contract unchanged.

Field-tested against the Zhipu Coding Plan endpoint in KSL-49:
same-sample accuracy on par with the production vision models
(qwen3.8-max / MiniMax-M3), locate IoU 0.698 with the glm-v
0-1000 bbox contract.

The model catalog docs (en/zh) list glm-5.3-flash under glm-v with
the always-thinking note.

Co-authored-by: jzli <jzli@alauda.io>
Co-authored-by: multica-agent <github@multica.ai>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Aug 31, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-08-31T11:10:07.513258Z 19be45c Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7cc20fcb6a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +58 to +59
} else if (userConfig.reasoningEffort) {
modelSpecificConfig.reasoning_effort = userConfig.reasoningEffort;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Avoid overriding effort in default reasoning mode

When a GLM-5.3 user sets MIDSCENE_MODEL_REASONING_ENABLED=default together with MIDSCENE_MODEL_REASONING_EFFORT, this branch still emits reasoning_effort. This violates the unified contract documented in apps/site/docs/en/model-config.mdx:88, where default follows provider behavior and ignores explicit effort settings, so users selecting that mode unexpectedly continue overriding the provider default.

Useful? React with 👍 / 👎.

Comment on lines +56 to +57
modelSpecificConfig.reasoning_effort =
userConfig.reasoningEffort ?? 'low';

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve normal effort when reasoning is enabled

When reasoningEnabled is explicitly true and no effort is supplied, this expression assigns low, just as it does for the disable case. The intended substitution described above is specifically for a no-reasoning request on an always-thinking model; applying it to users who force-enable reasoning silently minimizes reasoning and can reduce task accuracy. Use low only for the disabled/unset path and preserve the provider's effort default when reasoning is explicitly enabled.

Useful? React with 👍 / 👎.


| Model version | Commonly used model names | `MIDSCENE_MODEL_FAMILY` | Notes |
| --- | --- | --- | --- |
| GLM-5.3 series | `glm-5.3-flash` | `glm-v` | Always-thinking: `thinking.type` cannot be disabled, so disabling reasoning sends `reasoning_effort: low` instead. |

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Document GLM-5.3 reasoning-effort support

The adapter now consumes MIDSCENE_MODEL_REASONING_EFFORT for GLM-5.3-Flash, but the authoritative supported-family list in apps/site/docs/{en,zh}/model-config.mdx still omits GLM and says only the listed families support this setting. Users therefore cannot discover the knob that the implementation and this new row rely on; add GLM-5.3-Flash to both language versions of that list. apps/site/agents.mdL5-L5

Useful? React with 👍 / 👎.

…tract

Address review feedback on web-infra-dev#3071:
- reasoningEnabled=default no longer forwards reasoning_effort; the default
  mode follows provider behavior and ignores explicit effort settings, as
  documented in model-config.mdx.
- A 'low' effort is now applied only for the no-reasoning intent (explicit
  false or unset); explicitly enabling reasoning without an effort keeps the
  provider default instead of silently minimizing reasoning.
- List Zhipu GLM (glm-5.3-flash) in the MIDSCENE_MODEL_REASONING_EFFORT
  supported families in both en/zh model-config.mdx.
- Cover both behavior changes with unit tests.
@kinsolee

Copy link
Copy Markdown
Author

Thanks for the review — all three points are addressed in 19be45c:

  1. Effort override in default mode (glm.ts:59): reasoningEnabled='default' now sends neither a thinking nor an effort override; explicit MIDSCENE_MODEL_REASONING_EFFORT is ignored in that mode per the documented contract.
  2. Forced low when reasoning is enabled (glm.ts:57): the low mapping now applies only to the no-reasoning intent (explicit false or unset). Explicitly enabling reasoning without an effort keeps the provider default; an explicit effort is still forwarded.
  3. Docs (model-config.mdx): Zhipu GLM (glm-5.3-flash only) added to the MIDSCENE_MODEL_REASONING_EFFORT supported-families list in both en and zh.

Both behavior changes are covered by new unit tests (keeps the provider effort default when reasoning is explicitly enabled without effort, ignores an explicit effort in default reasoning mode for glm-5.3-flash).

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Delightful!

Reviewed commit: 19be45cbac

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant