fix(providers): give each CommandCode profile its own base-URL var for desktop parity
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.
This commit is contained in:
@@ -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/",
|
||||
|
||||
Reference in New Issue
Block a user