Repository navigation
Add Z.AI provider support for GLM-5 - #938
Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request integrates Z.AI's GLM-5 model as a native provider, streamlining its configuration and usage within the system. By reusing the established OpenAI-compatible chat completions infrastructure, it offers a low-risk implementation that enhances user experience for Z.AI users by making GLM-5 easily discoverable and accessible without requiring manual setup. Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request adds support for the Z.AI provider for GLM-5 models. The changes include updating the feature parity documentation, adding the provider definition to providers.json, and including a new regression test. The implementation is clean and follows existing patterns. I have one suggestion to improve the robustness of the new test case to better guard against future regressions in the provider's default configuration.
| let settings = Settings { | ||
| llm_backend: Some("bigmodel".to_string()), | ||
| selected_model: Some("glm-5".to_string()), | ||
| ..Default::default() | ||
| }; |
There was a problem hiding this comment.
This test is intended to verify the configuration resolution for the new zai provider, including its alias. However, by explicitly setting selected_model to "glm-5", the test doesn't verify that the default_model from providers.json is correctly configured. If the default_model in providers.json were to change or have a typo, this test would still pass, making it less effective as a regression test for the provider's default configuration.
To make the test more robust and ensure it validates the default configuration from the provider definition, I suggest removing the selected_model field. This will cause the configuration resolution to fall back to the default_model specified in providers.json, which is what we want to test for a new provider's default setup.
A similar test, registry_provider_resolves_tinfoil, already follows this pattern.
let settings = Settings {
llm_backend: Some("bigmodel".to_string()),
..Default::default()
};|
Could you review this when you get a chance? @zmanian |
zmanian
left a comment
There was a problem hiding this comment.
Review: Add Z.AI provider support for GLM-5
Clean, minimal addition. Reuses the existing OpenAI-compatible provider path, which is the right approach.
providers.jsonentry is well-structured with alias (bigmodel), correct protocol, and setup config- Test covers alias resolution and canonical backend normalization, following existing test patterns
- FEATURE_PARITY.md updated accurately
- Trailing newline fix on providers.json is a nice cleanup
No concerns. LGTM.
- add a minimal `zai` registry provider using the existing OpenAI-compatible chat completions path - configure default Z.AI endpoint, API key env vars, default model, and setup wizard key URL - add a config regression test covering `bigmodel` alias resolution and canonical backend normalization - update FEATURE_PARITY.md to mark GLM-5 as supported via the new provider Value: - makes GLM-5 a first-class provider instead of requiring manual openai_compatible setup - keeps the implementation low-risk by reusing the existing provider registry and adapter path - improves onboarding and discoverability for Z.AI users with no behavioral changes to other providers
eaedff4 to
cb34170
Compare
Summary
zairegistry provider using the existing OpenAI-compatible chat completions pathbigmodelalias resolution and canonical backend normalizationValue:
Change Type
Linked Issue
None
Validation
cargo fmtcargo clippy --all --benches --tests --examples --all-featuresSecurity Impact
None
Database Impact
None
Blast Radius
Rollback Plan
Review track: