From 9adc6071904dba099b667700f3ec177b3fb95eca Mon Sep 17 00:00:00 2001 From: Teknium <127238744+teknium1@users.noreply.github.com> Date: Mon, 17 Aug 2026 02:51:29 -0700 Subject: [PATCH] fix(providers): give each CommandCode profile its own base-URL var for desktop parity MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The provider-parity contract requires every CANONICAL provider to render a card on the desktop Keys tab. /api/env rows are keyed by env var, and both CommandCode profiles shared the single COMMANDCODE_API_KEY — so the commandcode-anthropic profile had no row of its own and test_provider_parity failed on CI (slice 6/12). Fix: both profiles keep the shared API key, but each declares its own base-URL override var (COMMANDCODE_BASE_URL / COMMANDCODE_ANTHROPIC_BASE_URL), matching the sibling-provider pattern, so each renders its own card. Verified: test_provider_parity.py + commandcode + providers suites green locally (86 passed); PROVIDER_REGISTRY splits key vs base-URL vars correctly for both profiles. --- plugins/model-providers/commandcode/__init__.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/plugins/model-providers/commandcode/__init__.py b/plugins/model-providers/commandcode/__init__.py index 71db60c8e3..156f06535b 100644 --- a/plugins/model-providers/commandcode/__init__.py +++ b/plugins/model-providers/commandcode/__init__.py @@ -38,7 +38,11 @@ logger = logging.getLogger(__name__) # ── Shared constants ────────────────────────────────────────────────────────── _COMMANDCODE_BASE = "https://api.commandcode.ai/provider/v1" _COMMANDCODE_MODELS_URL = f"{_COMMANDCODE_BASE}/models" -_COMMANDCODE_ENV = ("COMMANDCODE_API_KEY",) +# Both profiles authenticate with the same key; each carries its own base-URL +# override var so each renders its own card on the desktop Keys tab (rows are +# keyed by env var, and the shared API key attributes to the first profile). +_COMMANDCODE_ENV = ("COMMANDCODE_API_KEY", "COMMANDCODE_BASE_URL") +_COMMANDCODE_ANTHROPIC_ENV = ("COMMANDCODE_API_KEY", "COMMANDCODE_ANTHROPIC_BASE_URL") def _fetch_commandcode_models( @@ -138,7 +142,7 @@ commandcode_anthropic = CommandCodeAnthropicProfile( name="commandcode-anthropic", aliases=("commandcode-claude",), api_mode="anthropic_messages", - env_vars=_COMMANDCODE_ENV, + env_vars=_COMMANDCODE_ANTHROPIC_ENV, display_name="CommandCode (Anthropic)", description="CommandCode — Claude models via Anthropic Messages API", signup_url="https://commandcode.ai/",