fix: improve /model user feedback + update docs
User messaging improvements: - Rejection: '(>_<) Error: not a valid model' instead of '(^_^) Warning: Error:' - Rejection: shows 'Model unchanged' + tip about /model and /provider - Session-only: explains 'this session only' with reason and 'will revert on restart' - Saved: clear '(saved to config)' confirmation Docs updated: - cli-commands.md, cli.md, messaging/index.md: /model now shows provider:model syntax, /provider command added to tables Test fixes: deduplicated test names, assertions match new messages.
This commit is contained in:
parent
d07d867718
commit
a23bcb81ce
6 changed files with 29 additions and 16 deletions
18
cli.py
18
cli.py
|
|
@ -2101,8 +2101,10 @@ class HermesCLI:
|
|||
validation = {"accepted": True, "persist": True, "recognized": False, "message": None}
|
||||
|
||||
if not validation.get("accepted"):
|
||||
print(f"(^_^) Warning: {validation.get('message')}")
|
||||
print(f"(^_^) Current model unchanged: {self.model}")
|
||||
print(f"(>_<) {validation.get('message')}")
|
||||
print(f" Model unchanged: {self.model}")
|
||||
if "Did you mean" not in (validation.get("message") or ""):
|
||||
print(" Tip: Use /model to see available models, /provider to see providers")
|
||||
else:
|
||||
self.model = new_model
|
||||
self.agent = None # Force re-init
|
||||
|
|
@ -2123,13 +2125,13 @@ class HermesCLI:
|
|||
if saved_model:
|
||||
print(f"(^_^)b Model changed to: {new_model}{provider_note} (saved to config)")
|
||||
else:
|
||||
print(f"(^_^) Model changed to: {new_model}{provider_note} (session only)")
|
||||
print(f"(^_^) Model changed to: {new_model}{provider_note} (this session only)")
|
||||
else:
|
||||
print(f"(^_^) Model changed to: {new_model}{provider_note} (session only)")
|
||||
|
||||
message = validation.get("message")
|
||||
if message:
|
||||
print(f" Warning: {message}")
|
||||
message = validation.get("message") or ""
|
||||
print(f"(^_^) Model changed to: {new_model}{provider_note} (this session only)")
|
||||
if message:
|
||||
print(f" Reason: {message}")
|
||||
print(" Note: Model will revert on restart. Use a verified model to save to config.")
|
||||
else:
|
||||
from hermes_cli.models import curated_models_for_provider, normalize_provider, _PROVIDER_LABELS
|
||||
from hermes_cli.auth import resolve_provider as _resolve_provider
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue