From 71c6b1ee992fa17cb47632092ef463cc758a0fce Mon Sep 17 00:00:00 2001 From: Teknium <127238744+teknium1@users.noreply.github.com> Date: Tue, 17 Mar 2026 02:51:49 -0700 Subject: [PATCH] fix: remove ANTHROPIC_BASE_URL env var to avoid collisions (#1675) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ANTHROPIC_BASE_URL collides with Claude Code and other Anthropic tooling. Remove it from the Anthropic provider — base URL overrides should go through config.yaml model.base_url instead. The Alibaba/DashScope provider has its own dedicated base URL and API key env vars which don't collide with anything. --- hermes_cli/auth.py | 1 - hermes_cli/config.py | 8 -------- hermes_cli/runtime_provider.py | 4 +--- 3 files changed, 1 insertion(+), 12 deletions(-) diff --git a/hermes_cli/auth.py b/hermes_cli/auth.py index f1341d5d6..54573acf1 100644 --- a/hermes_cli/auth.py +++ b/hermes_cli/auth.py @@ -138,7 +138,6 @@ PROVIDER_REGISTRY: Dict[str, ProviderConfig] = { auth_type="api_key", inference_base_url="https://api.anthropic.com", api_key_env_vars=("ANTHROPIC_API_KEY", "ANTHROPIC_TOKEN", "CLAUDE_CODE_OAUTH_TOKEN"), - base_url_env_var="ANTHROPIC_BASE_URL", ), "alibaba": ProviderConfig( id="alibaba", diff --git a/hermes_cli/config.py b/hermes_cli/config.py index 834b8a3fc..62d8a19a7 100644 --- a/hermes_cli/config.py +++ b/hermes_cli/config.py @@ -493,14 +493,6 @@ OPTIONAL_ENV_VARS = { "password": False, "category": "provider", }, - "ANTHROPIC_BASE_URL": { - "description": "Custom Anthropic-compatible API base URL (e.g. Alibaba Cloud DashScope)", - "prompt": "Anthropic Base URL", - "url": "", - "password": False, - "category": "provider", - "advanced": True, - }, "DASHSCOPE_API_KEY": { "description": "Alibaba Cloud DashScope API key for Qwen models", "prompt": "DashScope API Key", diff --git a/hermes_cli/runtime_provider.py b/hermes_cli/runtime_provider.py index db96edccd..34ae43be8 100644 --- a/hermes_cli/runtime_provider.py +++ b/hermes_cli/runtime_provider.py @@ -276,12 +276,10 @@ def resolve_runtime_provider( "No Anthropic credentials found. Set ANTHROPIC_TOKEN or ANTHROPIC_API_KEY, " "run 'claude setup-token', or authenticate with 'claude /login'." ) - # Support custom Anthropic-compatible endpoints via ANTHROPIC_BASE_URL - base_url = os.getenv("ANTHROPIC_BASE_URL", "").strip() or "https://api.anthropic.com" return { "provider": "anthropic", "api_mode": "anthropic_messages", - "base_url": base_url, + "base_url": "https://api.anthropic.com", "api_key": token, "source": "env", "requested_provider": requested_provider,