Repository navigation
Improve GLM 4.x provider support - #293
zwanski-start wants to merge 1 commit into
Conversation
- Add GLM 4.6 and GLM 4.5 to the GLM model list - Apply Z.ai's recommended API_TIMEOUT_MS=3000000 by default for GLM (new per-provider default_timeout_ms, overridable via api_timeout_ms) - Make the GLM base URL editable in Settings so mainland China accounts can use https://open.bigmodel.cn/api/anthropic - Fix the GLM hint text, which pointed at open.bigmodel.cn while the default endpoint is api.z.ai - Document GLM setup and add tests for provider env construction Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
🔍 QA report: ✅ PassedTester: Barbara (cubefarm agent, in a fresh session) · Round: 1 · Author: Ada The PR does what issue #10 asks: GLM 4.6/4.5 are added to the model list, GLM gets a default API_TIMEOUT_MS=3000000 (a saved api_timeout_ms still overrides it), and the GLM Base URL can be edited in Settings for mainland-China endpoints. I checked it end to end with no API key. Switching to GLM through the API and saving the bigmodel.cn URL plus GLM 4.5 in the browser produced the expected agent environment. Tests, lint, type check and build are green apart from failures that also happen on master. One non-blocking issue: at 390px phone width the 5th GLM model button is clipped.
🧪 Commands run
No browser screenshots were taken in this round. Posted by cubefarm · merges automatically once GitHub's checks pass |
Closes #10
GLM was already available as a provider in Settings → API Provider. This PR fills the gaps that kept GLM 4.x users from running reliably, especially during long planning phases (the problem described in the issue).
Changes
glm-4.6andglm-4.5. The full list is now GLM 5, 4.7 (default), 4.6, 4.5 and 4.5 Air. You can still type any other model ID.default_timeout_msinregistry.py. GLM sets it to Z.ai's recommendedAPI_TIMEOUT_MS=3000000, so long planning turns no longer hit the CLI's default timeout. A storedapi_timeout_mssetting still overrides it.https://open.bigmodel.cn/api/anthropicinstead of the defaulthttps://api.z.ai/api/anthropic. Before this, the URL could only be edited for Custom and Azure.test_api_providers.pycovering howget_effective_sdk_env()builds the GLM environment: defaults, overrides, the model list, and no timeout for providers that don't set one.Verification
pytest test_api_providers.py test_client.py: 25 passedruff check .andmypyon the changed files: cleannpm run lint: 0 errors (6 warnings, all pre-existing).npm run buildsucceeds.https://api.z.ai/api/anthropicwith a Change button) and all five GLM models.Assumptions
glm-4.5-airautomatically, so behaviour stays predictable.🤖 Generated with Claude Code