fix: allow env var overrides for Nous portal/inference URLs (#5419)
The _login_nous() call site was pre-filling portal_base_url, inference_base_url, client_id, and scope with pconfig defaults before passing them to _nous_device_code_login(). Since pconfig defaults are always truthy, the env var checks inside the function (HERMES_PORTAL_BASE_URL, NOUS_PORTAL_BASE_URL, NOUS_INFERENCE_BASE_URL) could never take effect. Fix: pass None from the call site when no CLI flag is provided, letting the function's own priority chain handle defaults correctly: explicit CLI flag > env var > pconfig default. Addresses the issue reported in PR #5397 by jquesnelle.
This commit is contained in:
@@ -2634,10 +2634,10 @@ 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,
|
||||
client_id=getattr(args, "client_id", None) or pconfig.client_id,
|
||||
scope=getattr(args, "scope", None) or pconfig.scope,
|
||||
portal_base_url=getattr(args, "portal_url", None),
|
||||
inference_base_url=getattr(args, "inference_url", None),
|
||||
client_id=getattr(args, "client_id", None),
|
||||
scope=getattr(args, "scope", None),
|
||||
open_browser=not getattr(args, "no_browser", False),
|
||||
timeout_seconds=timeout_seconds,
|
||||
insecure=insecure,
|
||||
|
||||
Reference in New Issue
Block a user