Skip to content

feat: Add GitHub Models provider (#579) - #584

Open
pranjalparmar wants to merge 3 commits into
andrewyng:mainfrom
pranjalparmar:feat/github-models
Open

feat: Add GitHub Models provider (#579)#584
pranjalparmar wants to merge 3 commits into
andrewyng:mainfrom
pranjalparmar:feat/github-models

Conversation

@pranjalparmar

Copy link
Copy Markdown

Fixes #579. Adds GitHub Models as an official provider using the OpenAI-compatible Azure inference endpoints. Based on user feedback, this also removes hardcoded model choices from all OpenAI-compatible providers, allowing users to enter any custom model string for ultimate flexibility.

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

Provider configuration logic may incorrectly treat prefilled defaults as an explicit user override, bypassing the intended “only add if suggested/available” gate.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Adds GitHub Models as a first-class model provider (via the OpenAI-compatible Azure inference endpoint) and adjusts provider configuration behavior so users can supply a custom “default model” string rather than being constrained to a curated list.

Changes:

  • Introduces github (GitHub Models) and zai-coding OpenAI-compatible providers in the provider registry.
  • Expands the curated model matrix with GitHub Models + Z AI Coding Plan entries.
  • Tweaks provider configuration to auto-add user-entered custom model strings, and adjusts the matrix-size guardrail in tests.
File summaries
File Description
tests/test_providers.py Raises the matrix size ceiling to accommodate newly added curated models.
coworker/server/manager.py Adjusts auto-add logic for recommended models during provider configuration.
coworker/providers/registry.py Adds configurable recommended_model field for OpenAI-compatible providers; registers GitHub Models + Z AI Coding Plan.
coworker/providers/matrix.py Adds curated model entries for GitHub Models and Z AI Coding Plan.
Review details

Suppressed comments (1)

coworker/providers/registry.py:628

  • Using env_key="GITHUB_TOKEN" will implicitly pick up the GitHub Actions-provided GITHUB_TOKEN in CI environments even when the user hasn’t intentionally configured GitHub Models, which can lead to confusing auth failures (or unintended token reuse) when this provider is selected. Consider using a provider-specific env var name to avoid collisions.
    _compat(
        "github",
        "GitHub Models",
        base_url="https://models.inference.ai.azure.com",
        recommended_model="gpt-4o",
        env_key="GITHUB_TOKEN",
        endpoint_help="GitHub Models API endpoint. Requires a GitHub Personal Access Token (PAT).",
  • Files reviewed: 4/4 changed files
  • Comments generated: 3
  • 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/providers/registry.py Outdated
@@ -265,26 +265,39 @@ def _compat(
) -> ProviderDescriptor:
"""Descriptor for an OpenAI-compatible vendor: key + a prefilled, editable endpoint."""
Comment thread tests/test_providers.py
Comment on lines 512 to +515
# Deliberately small: agent-capable current models only (owner call, 2026-07-04).
# 60→65 (2026-08-24): the stealth ox-alpha preview slug tipped it; reclaim slack by
# pruning retired entries before raising this again.
assert len(MATRIX) < 65
assert len(MATRIX) < 75
Comment thread coworker/server/manager.py Outdated
Comment on lines +3011 to +3015
# If the user explicitly typed a model, always add it.
# If falling back to the provider's default, only add it if the provider reports it as available.
should_add = bool(user_choice) or (rec and rec in self._suggested_models(name))

if should_add and rec:
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 support for GH copilot as a model provider

2 participants