From 7f892f265fe16eb8180a4768cbd571fa695c8553 Mon Sep 17 00:00:00 2001 From: briandevans <252620095+briandevans@users.noreply.github.com> Date: Sat, 16 May 2026 21:13:14 -0700 Subject: [PATCH] fix(cli): register `send` subcommand + add encoding on read_text (#27188 follow-up) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The recently-merged `feat(cli): add hermes send` (#27188, commit 29b1bd0e2) landed two small regressions that are now blocking CI on origin/main: 1. `hermes_cli/main.py::_BUILTIN_SUBCOMMANDS` doesn't include `"send"`, so `tests/hermes_cli/test_startup_plugin_gating.py:: test_builtin_set_covers_every_registered_subcommand` fails on every PR with `_BUILTIN_SUBCOMMANDS is missing these live subcommands: ['send']`. The failing test explicitly directs the fix: "Add them to hermes_cli/main.py::_BUILTIN_SUBCOMMANDS so plugin discovery can be skipped when the user targets them." Correctness is unaffected (missing entries just force unnecessary plugin discovery), but the ruff blocker and the parity test both have to pass for CI to go green again. 2. `hermes_cli/send_cmd.py:61` calls `Path(file_path).read_text()` without an explicit `encoding=` argument, which trips `ruff PLW1514` (`pathlib.Path(...).read_text without explicit encoding argument`). The `lint-diff-summary` bot already flagged this as `+1 new` on the merging PR. Both are mechanical fixes: * Insert `"send"` into the alphabetically-sorted `_BUILTIN_SUBCOMMANDS` frozenset between `"proxy"` and `"sessions"`. * Pass `encoding="utf-8"` to `read_text()` — matches the file's docstring intent (the value is fed straight into `send_message_tool`, which doesn't care about source encoding, but the codebase has standardised on explicit UTF-8 elsewhere). Same pattern as #24738 (lsp _BUILTIN_SUBCOMMANDS), which was salvage-merged via #25011 (71c6dd0dc). Co-Authored-By: Claude Opus 4.7 (1M context) --- hermes_cli/main.py | 2 +- hermes_cli/send_cmd.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hermes_cli/main.py b/hermes_cli/main.py index bd8fe6c5cffcb..ed3bf3b959ffc 100644 --- a/hermes_cli/main.py +++ b/hermes_cli/main.py @@ -9611,7 +9611,7 @@ def _build_provider_choices() -> list[str]: "config", "cron", "curator", "dashboard", "debug", "doctor", "dump", "fallback", "gateway", "hooks", "import", "insights", "kanban", "login", "logout", "logs", "lsp", "mcp", "memory", - "model", "pairing", "plugins", "postinstall", "profile", "proxy", "sessions", "setup", + "model", "pairing", "plugins", "postinstall", "profile", "proxy", "send", "sessions", "setup", "skills", "slack", "status", "tools", "uninstall", "update", "version", "webhook", "whatsapp", "chat", # Help-ish invocations — plugin commands not being listed in diff --git a/hermes_cli/send_cmd.py b/hermes_cli/send_cmd.py index 451bb3b4964c2..2d0c3418ea259 100644 --- a/hermes_cli/send_cmd.py +++ b/hermes_cli/send_cmd.py @@ -58,7 +58,7 @@ def _read_message_body( if file_path == "-": return sys.stdin.read() try: - return Path(file_path).read_text() + return Path(file_path).read_text(encoding="utf-8") except OSError as exc: print(f"hermes send: cannot read {file_path}: {exc}", file=sys.stderr) sys.exit(_USAGE_EXIT)