Skip to content

The agent that grows with you

refactor(hermes_cli): auth group B — final closer hug pass

Teknium1ecf5e96f967
diff --git a/hermes_cli/auth_device_flow.py b/hermes_cli/auth_device_flow.py
index a56d69a6033..4b3c2cb3427 100644
--- a/hermes_cli/auth_device_flow.py
+++ b/hermes_cli/auth_device_flow.py
@@ -159,8 +159,7 @@ def _resolve_verify(
if not os.path.isfile(ca_path):
logger.warning(
"CA bundle path does not exist: %s — falling back to default certificates",
- ca_path,
- )
+ ca_path)
return _default_verify()
return ssl.create_default_context(cafile=ca_path)
return _default_verify()
@@ -283,8 +282,7 @@ def _poll_for_token(
poll_interval=max(1, min(poll_interval, DEVICE_AUTH_POLL_INTERVAL_CAP_SECONDS)),
validate_success=_validate,
on_non_json_error=lambda _r: RuntimeError(
- "Token endpoint returned a non-JSON error response"
- ),
+ "Token endpoint returned a non-JSON error response"),
on_error=_error,
# Enriched at the SOURCE so the CLI login and the dashboard/desktop poller
# (web_server._nous_poller surfaces str(e) to the UI) both inherit the guidance.
diff --git a/hermes_cli/auth_nous.py b/hermes_cli/auth_nous.py
index fb2f3f75625..7fc0620fb2c 100644
--- a/hermes_cli/auth_nous.py
+++ b/hermes_cli/auth_nous.py
@@ -432,8 +432,7 @@ def _read_shared_nous_state() -> Optional[Dict[str, Any]]:
if not isinstance(payload, dict):
return None
has_tokens = (
- _nonempty_str(payload.get("refresh_token")) and _nonempty_str(payload.get("access_token"))
- )
+ _nonempty_str(payload.get("refresh_token")) and _nonempty_str(payload.get("access_token")))
return payload if has_tokens else None
@@ -1461,8 +1460,7 @@ def _pick_nous_model_after_login(
print(_policy_notice)
print(
f"Showing {len(model_ids)} curated models — "
- "use \"Enter custom model name\" for others."
- )
+ "use \"Enter custom model name\" for others.")
return _prompt_model_selection(
model_ids, pricing=pricing, unavailable_models=unavailable_models, portal_url=_portal,
unavailable_message=unavailable_message, confirm_provider="nous",
diff --git a/hermes_cli/auth_oauth_grants.py b/hermes_cli/auth_oauth_grants.py
index d6f188b8cb1..8c31082212f 100644
--- a/hermes_cli/auth_oauth_grants.py
+++ b/hermes_cli/auth_oauth_grants.py
@@ -491,8 +491,7 @@ def _heal_forked_single_use_oauth_grants(provider_id: str) -> Optional[Dict[str,
# ``_provider_state_transaction`` uses.
with _auth_store_lock():
profile_store = (
- _load_auth_store(profile_path) if profile_path.exists() else {"providers": {}}
- )
+ _load_auth_store(profile_path) if profile_path.exists() else {"providers": {}})
with _auth_store_lock(target_path=root_path):
root_store = _load_auth_store(root_path) if root_path.exists() else {"providers": {}}
run = _HealPass(profile_store, root_store, provider_id, root_singleton)