feat: Add first-class Z AI Coding Plan provider - #583
Open
pranjalparmar wants to merge 2 commits into
Open
Conversation
Resolves andrewyng#546 by adding the Z AI Coding Plan provider (zai-coding). Implements dynamic configuration by updating the _compat factory to support model_choices, allowing users to select their preferred Coding Plan model (e.g., GLM-5.2 or GLM-4 Coder) directly from the settings menu.
There was a problem hiding this comment.
🟡 Changes recommended
It introduces a couple of small but concrete issues (profile override behavior guard and trailing whitespace) that should be addressed to avoid unexpected configuration effects and potential lint failures.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Adds a first-class Z AI Coding Plan provider (zai-coding) so Coding Plan subscribers can configure the correct subscription endpoint/key without modifying the existing zai provider, and introduces a small extension to _compat to support model selection via model_choices.
Changes:
- Extend
_compatprovider factory to optionally expose a Default Model choice list (model_choices) in the provider settings UI. - Add new provider registry entry
zai-codingpointing tohttps://api.z.ai/api/coding/paas/v4and keyed byZAI_CODING_API_KEY. - Add
zai-coding:*model entries to the curated model matrix and allow provider configuration to prefer a profile-selected recommended model.
File summaries
| File | Description |
|---|---|
| coworker/server/manager.py | Prefer a configured recommended_model from the provider profile when auto-adding a model after provider setup. |
| coworker/providers/registry.py | Add optional model_choices support to _compat and register the new zai-coding provider. |
| coworker/providers/matrix.py | Add curated matrix entries for zai-coding models. |
Review details
- Files reviewed: 3/3 changed files
- Comments generated: 2
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| # Convenience: if the provider recommends a model and it's actually available, add it to | ||
| # the curated list so it shows up in the composer right after configuring the provider. | ||
| rec = d.recommended_model | ||
| rec = profile.get("recommended_model") or d.recommended_model |
Comment on lines
268
to
+270
| vendor = title.split(" (")[0] | ||
|
|
||
| fields = [ |
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.
Resolves #546 by adding the Z AI Coding Plan provider (
zai-coding). Implements dynamic configuration by updating the_compatfactory to supportmodel_choices, allowing users to select their preferred Coding Plan model (e.g., GLM-5.2 or GLM-4 Coder) directly from the settings menu.