Skip to content

The agent that grows with you

refactor(hermes_cli): setup cluster — join wrapped prose literals, drop blanks after local imports

Teknium71e0cb030112
diff --git a/hermes_cli/secret_prompt.py b/hermes_cli/secret_prompt.py
index 0849f577d98..b274c8f0b97 100644
--- a/hermes_cli/secret_prompt.py
+++ b/hermes_cli/secret_prompt.py
@@ -91,7 +91,6 @@ def _masked_secret_prompt_windows(prompt: str, *, mask: str) -> str:
def _masked_secret_prompt_posix(prompt: str, *, mask: str) -> str:
import termios
import tty
-
fd = sys.stdin.fileno()
old_attrs = termios.tcgetattr(fd)
try:
diff --git a/hermes_cli/secrets_cli.py b/hermes_cli/secrets_cli.py
index 662593ae477..98c662926cd 100644
--- a/hermes_cli/secrets_cli.py
+++ b/hermes_cli/secrets_cli.py
@@ -48,7 +48,6 @@ _NOT_BSM_TOKEN_WARNING_CONTINUING = (
def _load_bw():
"""Import ``agent.secret_sources.bitwarden`` on first use (crypto payload)."""
from agent.secret_sources import bitwarden as _bw
-
return _bw
@@ -332,8 +331,7 @@ def cmd_token(args: argparse.Namespace) -> int:
console.print(
f"[yellow]Warning: configured project {project_id} is not visible "
"to this machine account. Grant it access in the Bitwarden web "
- "app or re-run `hermes secrets bitwarden setup` to pick a "
- "different project.[/yellow]"
+ "app or re-run `hermes secrets bitwarden setup` to pick a different project.[/yellow]"
)
return True
diff --git a/hermes_cli/send_cmd.py b/hermes_cli/send_cmd.py
index 867f11e4d6a..6a6a4719346 100644
--- a/hermes_cli/send_cmd.py
+++ b/hermes_cli/send_cmd.py
@@ -97,7 +97,6 @@ def _list_targets(platform_filter: Optional[str], *, json_mode: bool) -> int:
# outbound sends) so `--list` never hides a working send target.
try:
from gateway.config import load_gateway_config
-
for plat in load_gateway_config().get_connected_platforms():
plat_name = getattr(plat, "value", str(plat))
if plat_name not in ("local", "api_server", "webhook"):
@@ -171,7 +170,6 @@ def _load_hermes_env() -> None:
# utf-8-sig can't strip a BOM once we fall back to latin-1.
import codecs
import io
-
raw = env_path.read_bytes()
if raw.startswith(codecs.BOM_UTF8):
raw = raw[len(codecs.BOM_UTF8) :]
@@ -266,8 +264,7 @@ _SEND_ARGUMENTS = (
"Delivery target. Format: 'platform' (home channel), "
"'platform:chat_id', 'platform:chat_id:thread_id', or "
"'platform:#channel-name'. Examples: telegram, "
- "telegram:-1001234567890:17585, discord:#ops, slack:C0123ABCD, "
- "signal:+15551234567."
+ "telegram:-1001234567890:17585, discord:#ops, slack:C0123ABCD, signal:+15551234567."
),
)),
(("message",), dict(nargs="?", default=None, help="Message text. If omitted, read from --file or stdin.")),
@@ -276,8 +273,7 @@ _SEND_ARGUMENTS = (
default=None,
help=(
"Read message body from PATH (text only). Use '-' to force stdin. "
- "To send an image/document as an attachment, use MEDIA:<path> in "
- "the message text instead."
+ "To send an image/document as an attachment, use MEDIA:<path> in the message text instead."
),
)),
(("-s", "--subject"), dict(metavar="LINE", default=None, help="Prepend a subject/header line before the message body.")),
diff --git a/hermes_cli/setup.py b/hermes_cli/setup.py
index bc9b135f930..a468e8cc483 100644
--- a/hermes_cli/setup.py
+++ b/hermes_cli/setup.py
@@ -598,7 +598,6 @@ def _record_send_consent_change(*, enabled: bool) -> None:
from hermes_cli.observability.shared_metrics import SharedMetricsStore
from hermes_cli.observability.shared_metrics_sender import reconcile_send_consent
from hermes_cli.sqlite_util import write_txn
-
with SharedMetricsStore()._connection() as connection, write_txn(connection):
reconcile_send_consent(connection, enabled)
except Exception:
diff --git a/hermes_cli/setup_platforms.py b/hermes_cli/setup_platforms.py
index 95c96bae60a..9903b382d6b 100644
--- a/hermes_cli/setup_platforms.py
+++ b/hermes_cli/setup_platforms.py
@@ -368,7 +368,6 @@ def setup_gateway(config: dict):
# `hermes setup gateway`). Gating it on messaging config left install-then-import machines
# with cron jobs and bot tokens but no process to serve them.
from hermes_cli.gateway import _is_service_running, supports_systemd_services, ensure_gateway_service
-
supports_systemd = supports_systemd_services()
print()
diff --git a/hermes_cli/setup_quick.py b/hermes_cli/setup_quick.py
index b9ddc0002ee..ec15d2d4b61 100644
--- a/hermes_cli/setup_quick.py
+++ b/hermes_cli/setup_quick.py
@@ -164,7 +164,6 @@ def _blank_slate_minimal_toolsets(config: dict):
try:
from toolsets import TOOLSETS
from hermes_cli.tools_config import CONFIGURABLE_TOOLSETS, _get_plugin_toolset_keys
-
all_keys = {k for k, _, _ in CONFIGURABLE_TOOLSETS}
all_keys.update(_get_plugin_toolset_keys())
# Plain TOOLSETS entries catch recovered toolsets like ``kanban``. Skip "hermes-*" platform