fix(cli): restore /model command handler#3548
Open
v1-100-lab wants to merge 1 commit intoNousResearch:mainfrom
Open
fix(cli): restore /model command handler#3548v1-100-lab wants to merge 1 commit intoNousResearch:mainfrom
v1-100-lab wants to merge 1 commit intoNousResearch:mainfrom
Conversation
The /model command was added to COMMAND_REGISTRY in PR NousResearch#3372 but the actual handler in process_command() was never restored. This caused the command to appear in /help and tab completion but fail with "Unknown command" when used. Root cause: The /model slash command was completely removed in commit 9783c9d (NousResearch#3080). While the registry entry was correctly re-added in NousResearch#3372 (since model_switch.py and related infrastructure still exist), the dispatch branch in ChatConsole.process_command() was overlooked. Fix: Add the missing `elif canonical == "model":` handler back to process_command(), using the existing model_switch module. The implementation is copied from the pre-removal code (9783c9d^) with no functional changes. Files changed: - cli.py: add model command handler (85 lines) - hermes_cli/commands.py: already had registry entry from NousResearch#3372 Now /model works as expected for interactive model switching with proper config persistence and custom endpoint support. Closes NousResearch#3372 (completes the restoration)
crxssrazr93
added a commit
to crxssrazr93/hermes-agent
that referenced
this pull request
Mar 29, 2026
Example plugin demonstrating the lifecycle hooks activated in NousResearch#3542. Auto-manages a local llama-server (or any OpenAI-compatible server) when the active model matches a locally configured model name. Features: - pre_llm_call hook: auto-starts the correct server on first message when hermes is configured with a local model name - on_session_end hook: kills the server on exit - switch_local_llm tool: mid-session model switching — the agent swaps the server when asked ("switch to the code model") - Declarative YAML config for model definitions (GGUF paths, context sizes, KV cache quantization, sampling params) replacing shell scripts The plugin is self-contained in docs/llm-switch-plugin-example/ with a README, example config, and full implementation. Users copy it to ~/.hermes/plugins/llm-switch/ to install. Complements NousResearch#3360 and NousResearch#3548 which restore /model as a slash command — once merged, /model custom:write would trigger the pre_llm_call hook to auto-start the right server seamlessly. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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?
Restores the missing
/modelcommand handler in the interactive CLI. The/modelcommand appeared in autocomplete and/help(via COMMAND_REGISTRY) but failed with "Unknown command" because the dispatch handler inprocess_command()was not restored when PR #3372 re-added the registry entry.The
/modelslash command was completely removed in commit 9783c9d (#3080). While the infrastructure (hermes_cli/model_switch.py) remained for ACP and other integrations, the interactive CLI handler was never put back. This PR adds that missing handler, restoring full/modelfunctionality for interactive use.Related Issue
Fixes the broken
/modelcommand introduced by incomplete restoration in #3372Type of Change
Changes Made
hermes_cli/commands.py:/modelentry added to COMMAND_REGISTRY (+2 lines) — already present from fix(commands): add missing /model command to COMMAND_REGISTRY #3372, included here for completenesscli.py: Addedelif canonical == "model":handler inprocess_command()(+85 lines) to dispatch tomodel_switch.switch_model()andswitch_to_custom_provider()How to Test
hermes/model openai:gpt-4o(or any valid model)/model custom(auto-detect from endpoint) and/model custom:litellm:moonshotai/kimi-k2-instruct/modelwithout arguments to see the model/providers display/helpshows/modelin the Configuration sectionChecklist
pytest tests/ -qand all tests pass (would like CI to verify; manual testing performed)cli-config.yaml.example— (N/A, no config changes)CONTRIBUTING.mdorAGENTS.md— (N/A, no workflow changes)Screenshots / Logs
(Optional: attach screenshot showing
/modelworking)