From bff47eee486858ec00744b08962c8854cc3dd030 Mon Sep 17 00:00:00 2001 From: Ben Date: Tue, 7 Apr 2026 15:48:16 +1000 Subject: [PATCH] fix: HERMES_PORTAL_BASE_URL env var ignored during Nous login MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit _login_nous() was passing pconfig.portal_base_url (hardcoded production URL) as a fallback when no --portal-url CLI flag was given. This meant _nous_device_code_login() received a truthy portal_base_url argument and never reached the env var fallback chain. Users setting HERMES_PORTAL_BASE_URL or NOUS_PORTAL_BASE_URL in .env to point at a staging portal were silently ignored — login always went to production. Fix: pass None when no CLI flag is provided, letting the downstream function properly check env vars before falling back to the default. Fallback chain is now: 1. --portal-url CLI arg 2. HERMES_PORTAL_BASE_URL env var 3. NOUS_PORTAL_BASE_URL env var 4. DEFAULT_NOUS_PORTAL_URL (production) Same fix applied to inference_base_url for consistency. --- hermes_cli/auth.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hermes_cli/auth.py b/hermes_cli/auth.py index 94cc08f2a4..d8c628bbaa 100644 --- a/hermes_cli/auth.py +++ b/hermes_cli/auth.py @@ -2577,8 +2577,8 @@ def _login_nous(args, pconfig: ProviderConfig) -> None: try: auth_state = _nous_device_code_login( - portal_base_url=getattr(args, "portal_url", None) or pconfig.portal_base_url, - inference_base_url=getattr(args, "inference_url", None) or pconfig.inference_base_url, + portal_base_url=getattr(args, "portal_url", None), + inference_base_url=getattr(args, "inference_url", None), client_id=getattr(args, "client_id", None) or pconfig.client_id, scope=getattr(args, "scope", None) or pconfig.scope, open_browser=not getattr(args, "no_browser", False),