fix(cli): register send subcommand + add encoding on read_text (#27188 follow-up) - #27258
Closed
briandevans wants to merge 1 commit into
Closed
fix(cli): register send subcommand + add encoding on read_text (#27188 follow-up)#27258briandevans wants to merge 1 commit into
send subcommand + add encoding on read_text (#27188 follow-up)#27258briandevans wants to merge 1 commit into
Conversation
…sResearch#27188 follow-up) The recently-merged `feat(cli): add hermes send` (NousResearch#27188, commit 29b1bd0) 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 NousResearch#24738 (lsp _BUILTIN_SUBCOMMANDS), which was salvage-merged via NousResearch#25011 (71c6dd0). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds the send command to the CLI's reserved command list and explicitly specifies UTF-8 encoding when reading message body files.
Changes:
- Register
sendas a known top-level CLI command. - Read message body files with explicit UTF-8 encoding rather than platform default.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| hermes_cli/send_cmd.py | Use explicit utf-8 encoding for Path.read_text to ensure consistent decoding across platforms. |
| hermes_cli/main.py | Insert "send" into the alphabetized list of reserved provider/command choices. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This comment was marked as spam.
This comment was marked as spam.
Contributor
Author
|
Closing — both fixes have since landed on |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The recently-merged
feat(cli): add hermes send(#27188, commit29b1bd0e2) landed two small regressions that are blocking CI onorigin/main:hermes_cli/main.py::_BUILTIN_SUBCOMMANDSdoesn't include"send", sotests/hermes_cli/test_startup_plugin_gating.py::test_builtin_set_covers_every_registered_subcommandfails on every PR.hermes_cli/send_cmd.py:61callsPath(file_path).read_text()without an explicitencoding=argument, trippingruff PLW1514(which is the blocking ruff job).Both are mechanical follow-ups directly directed by the failing checks.
The bug
1. Missing
"send"in_BUILTIN_SUBCOMMANDSThe parity test in
test_startup_plugin_gating.pyfails with the exact message:Correctness is unaffected (missing entries only force unnecessary plugin discovery for users running
hermes send …), but the parity test guards the perf invariant and has to stay green for CI.2. Missing
encoding=onread_text()The blocking
ruff enforcementjob fails with:The
lint-diff-summarybot already flagged this as+1 newon the merging PR forhermes/hermes-db18949e.The fix
"send"into the alphabetically-sorted_BUILTIN_SUBCOMMANDSfrozenset between"proxy"and"sessions".encoding="utf-8"toPath(file_path).read_text()insend_cmd.py:61.Same pattern as #24738 (lsp
_BUILTIN_SUBCOMMANDS), which was salvage-merged via #25011 (71c6dd0dc).Test plan
tests/hermes_cli/test_startup_plugin_gating.py— 37 passed (was 1 failed on cleanorigin/main).test_builtin_set_covers_every_registered_subcommandandtest_builtin_set_has_no_phantom_entriesboth pass.ruff check hermes_cli/send_cmd.py hermes_cli/main.py—All checks passed!(wasFound 1 erroron cleanorigin/main).FAILED ... _BUILTIN_SUBCOMMANDS is missing these live subcommands: ['send']. Restored the fix →PASSED.Related
hermes sendto pipe script output to any messaging platform (salvage of #19631) #27188 (feat(cli): add hermes send)_BUILTIN_SUBCOMMANDSparity-fix pattern for"lsp")