From 71e0cb030112c368264e5613ffcda6219970224a Mon Sep 17 00:00:00 2001 From: Teknium <127238744+teknium1@users.noreply.github.com> Date: Wed, 2 Sep 2026 21:20:04 -0700 Subject: [PATCH] =?UTF-8?q?refactor(hermes=5Fcli):=20setup=20cluster=20?= =?UTF-8?q?=E2=80=94=20join=20wrapped=20prose=20literals,=20drop=20blanks?= =?UTF-8?q?=20after=20local=20imports?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hermes_cli/secret_prompt.py | 1 - hermes_cli/secrets_cli.py | 4 +--- hermes_cli/send_cmd.py | 8 ++------ hermes_cli/setup.py | 1 - hermes_cli/setup_platforms.py | 1 - hermes_cli/setup_quick.py | 1 - 6 files changed, 3 insertions(+), 13 deletions(-) diff --git a/hermes_cli/secret_prompt.py b/hermes_cli/secret_prompt.py index 0849f577d9..b274c8f0b9 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 662593ae47..98c662926c 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 867f11e4d6..6a6a471934 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: in " - "the message text instead." + "To send an image/document as an attachment, use MEDIA: 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 bc9b135f93..a468e8cc48 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 95c96bae60..9903b382d6 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 b9ddc0002e..ec15d2d4b6 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