fix(cli): route local control commands offline#37988
Open
konsisumer wants to merge 1 commit into
Open
Conversation
Contributor
Author
|
Rebased onto |
ed5f947 to
7c33655
Compare
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.
What does this PR do?
Routes selected local Hermes control commands typed in the classic interactive CLI prompt through the local CLI instead of sending them to the agent. This lets users run
hermes config ...,hermes gateway stop/status/list,hermes debug ..., andhermes modelwithout first making a model API call, which avoids the 402 deadlock reported in #37858.Related Issue
Fixes #37858
Type of Change
Changes Made
cli.py: add an allowlistedhermes ...prompt fast path before regular chat dispatch, usingshlex.splitand argv-basedsubprocess.runwithout a shell.tests/cli/test_local_hermes_command_passthrough.py: cover allowlisted config/gateway commands, rejection of unrelated shell text, and subprocess argv dispatch.How to Test
pytest tests/cli/test_local_hermes_command_passthrough.py -q-> 4 passed.pytest tests/hermes_cli/test_gateway_restart_loop.py tests/hermes_cli/test_gateway.py tests/hermes_cli/test_set_config_value.py -q -x --timeout=60-> 99 passed.ruff check cli.py tests/cli/test_local_hermes_command_passthrough.pyandruff format --check tests/cli/test_local_hermes_command_passthrough.py-> passed.python scripts/check-windows-footguns.py cli.py tests/cli/test_local_hermes_command_passthrough.py-> passed.git diff --check-> passed.pytest tests/ -q -x --timeout=60was attempted, but local collection stopped before this change was exercised becausetests/hermes_cli/test_dashboard_auth_401_reauth.pyimports missing optional dependencyfastapi.pytest tests/cli -q -x --timeout=60was attempted as fallback coverage; it reached 283 passes, then timed out in unrelatedtests/cli/test_cli_preloaded_skills.py::test_show_banner_does_not_print_skillswhile lazy dependency installs and auxiliary provider/account failures were logged.Checklist
Code
fix(scope):,feat(scope):, etc.)pytest tests/ -qand all tests passDocumentation & Housekeeping
docs/, docstrings) — or N/Acli-config.yaml.exampleif I added/changed config keys — or N/ACONTRIBUTING.mdorAGENTS.mdif I changed architecture or workflows — or N/AFor New Skills
hermes --toolsets skills -q "Use the X skill to do Y"Screenshots / Logs
N/A