mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-06-09 08:21:50 +00:00
refactor(cli): extract 32 slash-command handlers into CLICommandsMixin (god-file Phase 4)
Lift the `_handle_*_command` cluster (2,077 LOC) out of HermesCLI into hermes_cli/cli_commands_mixin.py; HermesCLI now inherits CLICommandsMixin so every self.<handler> call resolves unchanged via the MRO. Behavior-neutral. Import discipline mirrors gateway/slash_commands.py (PR #41886): neutral deps imported at the mixin module top level; cli.py-internal helpers/constants (_cprint, _ACCENT, save_config_value, ...) imported lazily inside each handler via 'from cli import ...' so the mixin never imports cli at module scope. cli.py 16215 -> 14139 LOC. One test mock repointed (cli.is_browser_debug_ready -> hermes_cli.cli_commands_mixin.is_browser_debug_ready).
This commit is contained in:
parent
4eb8972390
commit
0904bc7ea2
3 changed files with 2178 additions and 2079 deletions
2175
hermes_cli/cli_commands_mixin.py
Normal file
2175
hermes_cli/cli_commands_mixin.py
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -238,7 +238,7 @@ class TestChromeDebugLaunch:
|
|||
cli._pending_input = Queue()
|
||||
monkeypatch.delenv("BROWSER_CDP_URL", raising=False)
|
||||
|
||||
with patch("cli.is_browser_debug_ready", return_value=True), \
|
||||
with patch("hermes_cli.cli_commands_mixin.is_browser_debug_ready", return_value=True), \
|
||||
patch("tools.browser_tool.cleanup_all_browsers"), \
|
||||
patch("tools.browser_tool._ensure_cdp_supervisor"), \
|
||||
redirect_stdout(StringIO()):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue