Skip to content

[feat] providers: add Zhipu BigModel GLM chat support - #245

Merged
FayeSpica merged 5 commits into
ThinkFlowLab:mainfrom
MrDongsls:feat/zhipu-glm-chat
Nov 10, 2026
Merged

FayeSpica merged 5 commits into
ThinkFlowLab:mainfrom
MrDongsls:feat/zhipu-glm-chat

Conversation

@MrDongsls

@MrDongsls MrDongsls commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Closes #236. Parent RFC: #234

Summary

  • Register the Zhipu BigModel provider preset with its canonical URL https://open.bigmodel.cn/api/paas/v4, the Z.ai brand logo and a curated GLM agent model catalog, so GLM models appear in the assistant Default group exactly like other chat providers. The preset ships a fixed model list because the platform does not document a model listing endpoint; manual model IDs stay available.
  • Map the shared thinking levels to GLM reasoning_effort in the shared chat payload. GLM accepts only low, high and max, the auto level omits the parameter so the provider default applies, and unknown levels fall back as in the DeepSeek branch. No protocol, runtime or agent loop changes were needed: streaming and tool calling flow through the existing default assistant runtime.
  • Cover the preset shape, bilingual labels and saved connection identity with node tests, the effort mapping with Python tests, and the provider form and assistant picker in both display languages with an isolated browser case.
  • Record the validation commands and the real credential acceptance boundary in the validation guide.

Evidence

  1. Provider form: preset URL prefilled, three GLM models preselected, the per-model test passed and the saved key not echoed after reopening.
Image
  1. Tool calling: the agent wrote a text asset with asset write-text, added it to the canvas with canvas add-material, and reported the executed steps; the text node appeared on the canvas.
Image
  1. English interface showing Zhipu BigModel with the key configured. Image

Both acceptance items from the issue were verified with the real connection: a streaming conversation, and an assistant turn that called OpenDirector tools, received results and continued the conversation. One of six tool calls in that run failed and the agent loop recovered on retry; the final canvas state and reply were correct.

Validation

  • .venv/bin/python -m pytest tests -q: 1260 passed, 7 failed, 6 skipped at 242906a. The 7 voice library failures also fail on upstream main f06e22f without this commit, so they are pre-existing on the rebased base
  • npm test: 695 passed, 0 failed
  • npm run build
  • npm run check:i18n
  • CREATION_API_URL=http://127.0.0.1:8019 CREATION_WEB_URL=http://127.0.0.1:5179 node tests/browser/zhipu_provider.mjs: passed, no request reaches open.bigmodel.cn

@MrDongsls
MrDongsls marked this pull request as ready for review November 9, 2026 16:57
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-09T17:01:33.384100Z 242906a Draft marked ready
ℹ️ 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.

- Register the Zhipu BigModel provider preset with its canonical URL, the
  Z.ai brand logo and the GLM agent model catalog.
- Map the shared thinking levels to GLM reasoning_effort in the shared chat
  payload. GLM accepts only low, high and max, auto omits the parameter and
  unknown levels fall back as in the DeepSeek branch.
- Cover the preset shape, bilingual labels, saved connection identity and
  effort mapping with tests, and the provider form and assistant picker with
  an isolated browser case.

- .venv/bin/python -m pytest tests -q: 1083 passed, 6 skipped
- npm test: 678 passed
- npm run build
- npm run check:i18n
- CREATION_API_URL=http://127.0.0.1:8019 CREATION_WEB_URL=http://127.0.0.1:5179 node tests/browser/zhipu_provider.mjs
- Real credential acceptance: streaming conversation, tool call execution and
  both display languages verified against open.bigmodel.cn with screenshots.

Refs: ThinkFlowLab#236
@MrDongsls
MrDongsls force-pushed the feat/zhipu-glm-chat branch from 242906a to a4bb700 Compare November 9, 2026 16:59
@hsliuustc0106

Copy link
Copy Markdown
Contributor

fix conflicts

@hsliuustc0106 hsliuustc0106 added type:feat New capability or behaviour area:provider Model providers and generation protocols labels Nov 10, 2026
@MrDongsls

Copy link
Copy Markdown
Contributor Author

Conflict already fixed in 781d35567bad50ecef4c34cb4ca659c6604b62e7.

@FayeSpica FayeSpica left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks! Please fix the browser manifest check before merging.

Comment thread tests/browser/zhipu_provider.mjs Resolved
Comment thread tests/browser/zhipu_provider.mjs Resolved
## summary

- Register the Zhipu provider browser workflow in the extended lane.
- Reuse the assistant picker check for both Chinese and English labels.
## summary

- Run Chinese and English picker checks on fresh pages and projects.
- Keep saved model configuration shared while avoiding assistant state and
  project lease interference.

## validation

- node tests/browser/zhipu_provider.mjs
- node --check tests/browser/zhipu_provider.mjs
- git diff --staged --check

Signed-off-by: MrDongsls <dhy1042542469@126.com>
@MrDongsls

Copy link
Copy Markdown
Contributor Author

@FayeSpica Thanks for your review! Both problems are addressed in 3abe062 and ad65c41.

@FayeSpica

Copy link
Copy Markdown
Collaborator

Let’s wait for CI to pass before moving forward.

@MrDongsls

Copy link
Copy Markdown
Contributor Author

@FayeSpica I investigated the CI failure and found it was an intermittent storage_busy session-lease race during voice-library cold reopen (the PR does not touch that path); could you please re-run CI?

@FayeSpica FayeSpica left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM now.

Thanks!

@FayeSpica
FayeSpica merged commit 4d15b4e into ThinkFlowLab:main Nov 10, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:provider Model providers and generation protocols type:feat New capability or behaviour

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[feat] providers: add Zhipu BigModel GLM chat support

3 participants