Skip to content

feat: Add first-class Z AI Coding Plan provider - #583

Open
pranjalparmar wants to merge 2 commits into
andrewyng:mainfrom
pranjalparmar:feat/zai-coding-provider
Open

feat: Add first-class Z AI Coding Plan provider#583
pranjalparmar wants to merge 2 commits into
andrewyng:mainfrom
pranjalparmar:feat/zai-coding-provider

Conversation

@pranjalparmar

Copy link
Copy Markdown

Resolves #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.

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.

Copilot AI 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.

🟡 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 _compat provider factory to optionally expose a Default Model choice list (model_choices) in the provider settings UI.
  • Add new provider registry entry zai-coding pointing to https://api.z.ai/api/coding/paas/v4 and keyed by ZAI_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.

Comment thread coworker/server/manager.py Outdated
# 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 = [
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.

Add a first-class Z AI Coding Plan provider (subscription endpoint api.z.ai/api/coding/paas/v4)

2 participants