The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
feat(cli): /model reset in the classic CLI, help hint and queued-pick display (salvage #74899)
Teknium66c48cb158de
diff --git a/hermes_cli/cli_model_switch_mixin.py b/hermes_cli/cli_model_switch_mixin.pyindex 50cc1132028..d7e0a45fb04 100644--- a/hermes_cli/cli_model_switch_mixin.py+++ b/hermes_cli/cli_model_switch_mixin.py@@ -263,6 +263,18 @@ _MODEL_USAGE_ROWS = (_MODEL_USAGE_COL = 36+def _configured_default_route() -> tuple[str, str]:+ """``(model, provider)`` config.yaml names NOW (``/model reset``'s target). A fresh read, not the+ startup snapshot: the dashboard or another surface may have changed the default since launch."""+ from hermes_cli.config import load_config_readonly+ model_cfg = (load_config_readonly() or {}).get("model")+ if not isinstance(model_cfg, dict):+ return (model_cfg.strip() if isinstance(model_cfg, str) else ""), ""+ provider = str(model_cfg.get("provider") or "").strip()+ return (str(model_cfg.get("default") or model_cfg.get("model") or "").strip(),+ "" if provider.lower() == "auto" else provider)++def _picker_reasoning_rows() -> list[tuple[str, str]]:"""``(value, label)`` rows for the picker's effort step: the canonical ladder, the off state,then a keep-current row (empty value = leave the effort alone)."""@@ -965,6 +977,7 @@ class CLIModelSwitchMixin:/model <name> --provider <provider> — switch provider + model/model <name> --reasoning <level> — switch and set reasoning effort in one step/model --provider <provider> — switch to provider, auto-detect model+ /model reset — back to config.yaml's model (keeps history)Switches are session-scoped unless ``model.persist_switch_by_default`` or ``--global``."""@@ -977,8 +990,20 @@ class CLIModelSwitchMixin:# CLI decoration: " ✗ " prefix over the canonical error copy._cprint(f" ✗ {request.error_messages()[0]}")return+ target, explicit_provider = request.target, request.explicit_provider+ if request.is_reset:+ # Session-scoped switch back to config.yaml's model; drops an armed --once restore,+ # which would otherwise re-plant the model being reset away from after the next turn.+ target, explicit_provider = _configured_default_route()+ if not target:+ _cprint(f" ✗ {t('cli.model.reset_no_default')}")+ return+ if target == self.model and explicit_provider in ("", self.provider):+ self._pending_one_turn_model_restore = None+ _cprint(f" {t('cli.model.reset_none', model=target)}")+ returnone_turn = request.is_once- persist_global = resolve_persist_behavior(+ persist_global = not request.is_reset and resolve_persist_behavior(request.is_global, request.is_session, is_once=one_turn,explicit_provider=request.explicit_provider)@@ -1007,8 +1032,7 @@ class CLIModelSwitchMixin:return _show_model_picker(self, ctx, request.force_refresh)result = _switch_model_from(- self, request.target, is_global=persist_global,- explicit_provider=request.explicit_provider,+ self, target, is_global=persist_global, explicit_provider=explicit_provider,user_providers=user_provs, custom_providers=custom_provs)if not result.success:_cprint(f" ✗ {result.error_message}")diff --git a/hermes_cli/commands.py b/hermes_cli/commands.pyindex 34c0e06abc7..57c6120caeb 100644--- a/hermes_cli/commands.py+++ b/hermes_cli/commands.py@@ -187,7 +187,7 @@ COMMAND_REGISTRY: list[CommandDef] = [CommandDef("config", "Show current configuration", "Configuration",cli_only=True),CommandDef("model", "Switch model (session-scoped; --global to persist)", "Configuration",- args_hint="[model] [--provider name] [--reasoning level] [--global|--session] [--refresh]",+ args_hint="[model|reset] [--provider name] [--reasoning level] [--global|--session] [--refresh]",busy_policy="reject", busy_handler="model", desktop="hidden"),CommandDef("codex-runtime", "Toggle codex app-server runtime for OpenAI/Codex models","Configuration", aliases=("codex_runtime",), args_hint="[auto|codex_app_server]",diff --git a/locales/af.yaml b/locales/af.yamlindex 9f919d62ae5..dec94285642 100644--- a/locales/af.yaml+++ b/locales/af.yaml@@ -2012,6 +2012,8 @@ cli:usage_switch_reasoning: "verander en stel redenering-inspanning"usage_switch_provider: "verander verskaffer"usage_refresh: "haal lewendige modellyste weer op"+ reset_none: "Reeds op die gekonfigureerde verstek ({model}) — niks om terug te stel nie."+ reset_no_default: "Geen model.default in config.yaml nie — niks om na terug te stel nie."choice_switch_anyway: "Verander in elk geval"desc_switch_anyway: "Gebruik hierdie model vir die huidige Hermes-sessie."choice_cancel: "Kanselleer"diff --git a/locales/ar.yaml b/locales/ar.yamlindex 63346f84915..e26fcbb413f 100644--- a/locales/ar.yaml+++ b/locales/ar.yaml@@ -2012,6 +2012,8 @@ cli:usage_switch_reasoning: "التبديل وتعيين مستوى الاستدلال"usage_switch_provider: "تبديل المزوّد"usage_refresh: "إعادة جلب قوائم النماذج الحية"+ reset_none: "يُستخدم بالفعل النموذج الافتراضي المُعدّ ({model}) — لا شيء لإعادة تعيينه."+ reset_no_default: "لا يوجد model.default في config.yaml — لا شيء لإعادة التعيين إليه."choice_switch_anyway: "التبديل على أي حال"desc_switch_anyway: "استخدام هذا النموذج لجلسة Hermes الحالية."choice_cancel: "إلغاء"diff --git a/locales/de.yaml b/locales/de.yamlindex d81c2772e87..fe31c5c5ca3 100644--- a/locales/de.yaml+++ b/locales/de.yaml@@ -2012,6 +2012,8 @@ cli:usage_switch_reasoning: "wechseln und Reasoning-Stärke setzen"usage_switch_provider: "Anbieter wechseln"usage_refresh: "Live-Modelllisten neu abrufen"+ reset_none: "Bereits auf dem konfigurierten Standard ({model}) — nichts zurückzusetzen."+ reset_no_default: "Kein model.default in config.yaml — nichts, worauf zurückgesetzt werden kann."choice_switch_anyway: "Trotzdem wechseln"desc_switch_anyway: "Dieses Modell für die aktuelle Hermes-Sitzung verwenden."choice_cancel: "Abbrechen"diff --git a/locales/en.yaml b/locales/en.yamlindex a876e1e298d..2489043493a 100644--- a/locales/en.yaml+++ b/locales/en.yaml@@ -2105,6 +2105,8 @@ cli:usage_switch_reasoning: "switch and set reasoning effort"usage_switch_provider: "switch provider"usage_refresh: "re-fetch live model lists"+ reset_none: "Already on the configured default ({model}) — nothing to reset."+ reset_no_default: "No model.default in config.yaml — nothing to reset to."choice_switch_anyway: "Switch anyway"desc_switch_anyway: "Use this model for the current Hermes session."choice_cancel: "Cancel"diff --git a/locales/es.yaml b/locales/es.yamlindex 4dd59165ad2..42d20d32038 100644--- a/locales/es.yaml+++ b/locales/es.yaml@@ -2012,6 +2012,8 @@ cli:usage_switch_reasoning: "cambiar y establecer el esfuerzo de razonamiento"usage_switch_provider: "cambiar de proveedor"usage_refresh: "recargar las listas de modelos"+ reset_none: "Ya se usa el predeterminado configurado ({model}): no hay nada que restablecer."+ reset_no_default: "No hay model.default en config.yaml: no hay nada a lo que volver."choice_switch_anyway: "Cambiar de todos modos"desc_switch_anyway: "Usar este modelo en la sesión actual de Hermes."choice_cancel: "Cancelar"diff --git a/locales/fr.yaml b/locales/fr.yamlindex 21ba569f2c7..087bb40895f 100644--- a/locales/fr.yaml+++ b/locales/fr.yaml@@ -2264,6 +2264,8 @@ cli:usage_switch_reasoning: "changer et définir l'effort de raisonnement"usage_switch_provider: "changer de fournisseur"usage_refresh: "recharger les listes de modèles en direct"+ reset_none: "Déjà sur le modèle par défaut configuré ({model}) — rien à réinitialiser."+ reset_no_default: "Aucun model.default dans config.yaml — rien vers quoi revenir."choice_switch_anyway: "Changer quand même"desc_switch_anyway: "Utiliser ce modèle pour la session Hermes en cours."choice_cancel: "Annuler"diff --git a/locales/ga.yaml b/locales/ga.yamlindex beb1da3c3fb..5e11d0e3cba 100644--- a/locales/ga.yaml+++ b/locales/ga.yaml@@ -2012,6 +2012,8 @@ cli:usage_switch_reasoning: "athraigh agus socraigh iarracht réasúnaíochta"usage_switch_provider: "athraigh an soláthraí"usage_refresh: "faigh liostaí beo na samhlacha arís"+ reset_none: "Ar an réamhshocrú cumraithe cheana ({model}) — níl aon rud le hathshocrú."+ reset_no_default: "Níl model.default in config.yaml — níl aon rud le filleadh air."choice_switch_anyway: "Athraigh ar aon nós"desc_switch_anyway: "Úsáid an tsamhail seo don seisiún Hermes reatha."choice_cancel: "Cealaigh"diff --git a/locales/hu.yaml b/locales/hu.yamlindex 11967d73a04..41c2669218b 100644--- a/locales/hu.yaml+++ b/locales/hu.yaml@@ -2029,6 +2029,8 @@ cli:usage_switch_reasoning: "váltás és gondolkodási szint beállítása"usage_switch_provider: "szolgáltató váltása"usage_refresh: "élő modellisták újratöltése"+ reset_none: "Már a beállított alapértelmezés ({model}) van használatban — nincs mit visszaállítani."+ reset_no_default: "Nincs model.default a config.yaml-ban — nincs mire visszaállni."choice_switch_anyway: "Váltás mindenképp"desc_switch_anyway: "Ennek a modellnek a használata a jelenlegi Hermes-munkamenetben."choice_cancel: "Mégse"diff --git a/locales/it.yaml b/locales/it.yamlindex 6f4c85dd1d8..044cfef6376 100644--- a/locales/it.yaml+++ b/locales/it.yaml@@ -2012,6 +2012,8 @@ cli:usage_switch_reasoning: "cambia e imposta il livello di ragionamento"usage_switch_provider: "cambia provider"usage_refresh: "ricarica gli elenchi dei modelli disponibili"+ reset_none: "Già sul predefinito configurato ({model}) — niente da ripristinare."+ reset_no_default: "Nessun model.default in config.yaml — niente a cui tornare."choice_switch_anyway: "Cambia comunque"desc_switch_anyway: "Usa questo modello per la sessione Hermes corrente."choice_cancel: "Annulla"diff --git a/locales/ja.yaml b/locales/ja.yamlindex 6309dfd9222..1aa7f1388e1 100644--- a/locales/ja.yaml+++ b/locales/ja.yaml@@ -2012,6 +2012,8 @@ cli:usage_switch_reasoning: "切り替えて推論の強度を設定"usage_switch_provider: "プロバイダーを切り替え"usage_refresh: "最新のモデル一覧を再取得"+ reset_none: "すでに設定済みのデフォルト({model})を使用中です — リセットするものはありません。"+ reset_no_default: "config.yaml に model.default がありません — 戻す先がありません。"choice_switch_anyway: "それでも切り替える"desc_switch_anyway: "現在の Hermes セッションでこのモデルを使用します。"choice_cancel: "キャンセル"diff --git a/locales/ko.yaml b/locales/ko.yamlindex a5aa14f74ee..6fb0e46c25d 100644--- a/locales/ko.yaml+++ b/locales/ko.yaml@@ -2012,6 +2012,8 @@ cli:usage_switch_reasoning: "전환하고 추론 강도 설정"usage_switch_provider: "제공자 전환"usage_refresh: "실시간 모델 목록 다시 가져오기"+ reset_none: "이미 설정된 기본값({model})을 사용 중입니다 — 재설정할 것이 없습니다."+ reset_no_default: "config.yaml에 model.default가 없습니다 — 되돌릴 대상이 없습니다."choice_switch_anyway: "그래도 전환"desc_switch_anyway: "현재 Hermes 세션에서 이 모델을 사용해요."choice_cancel: "취소"diff --git a/locales/pt.yaml b/locales/pt.yamlindex 5fb301b9fb4..b02f9c91caf 100644--- a/locales/pt.yaml+++ b/locales/pt.yaml@@ -2012,6 +2012,8 @@ cli:usage_switch_reasoning: "trocar e definir o esforço de raciocínio"usage_switch_provider: "trocar fornecedor"usage_refresh: "buscar novamente as listas de modelos"+ reset_none: "Já está no padrão configurado ({model}) — nada para redefinir."+ reset_no_default: "Nenhum model.default no config.yaml — nada para onde voltar."choice_switch_anyway: "Trocar mesmo assim"desc_switch_anyway: "Usar este modelo na sessão atual do Hermes."choice_cancel: "Cancelar"diff --git a/locales/ru.yaml b/locales/ru.yamlindex bc4d74e6943..d2f0df81bc7 100644--- a/locales/ru.yaml+++ b/locales/ru.yaml@@ -2012,6 +2012,8 @@ cli:usage_switch_reasoning: "переключить и задать уровень рассуждений"usage_switch_provider: "переключить провайдера"usage_refresh: "заново загрузить актуальные списки моделей"+ reset_none: "Уже используется настроенная модель по умолчанию ({model}) — сбрасывать нечего."+ reset_no_default: "В config.yaml нет model.default — возвращаться не к чему."choice_switch_anyway: "Всё равно переключить"desc_switch_anyway: "Использовать эту модель в текущем сеансе Hermes."choice_cancel: "Отмена"diff --git a/locales/tr.yaml b/locales/tr.yamlindex bfaf4abe090..63cfad25f2f 100644--- a/locales/tr.yaml+++ b/locales/tr.yaml@@ -2012,6 +2012,8 @@ cli:usage_switch_reasoning: "değiştir ve akıl yürütme düzeyini ayarla"usage_switch_provider: "sağlayıcıyı değiştir"usage_refresh: "canlı model listelerini yeniden getir"+ reset_none: "Zaten yapılandırılmış varsayılan ({model}) kullanılıyor — sıfırlanacak bir şey yok."+ reset_no_default: "config.yaml içinde model.default yok — dönülecek bir şey yok."choice_switch_anyway: "Yine de değiştir"desc_switch_anyway: "Bu modeli geçerli Hermes oturumu için kullanın."choice_cancel: "İptal"diff --git a/locales/uk.yaml b/locales/uk.yamlindex a0379941610..697fd9dbb2d 100644--- a/locales/uk.yaml+++ b/locales/uk.yaml@@ -2012,6 +2012,8 @@ cli:usage_switch_reasoning: "змінити модель і задати рівень міркувань"usage_switch_provider: "змінити провайдера"usage_refresh: "повторно отримати актуальні списки моделей"+ reset_none: "Уже використовується налаштована типова модель ({model}) — скидати нічого."+ reset_no_default: "У config.yaml немає model.default — повертатися нема до чого."choice_switch_anyway: "Усе одно змінити"desc_switch_anyway: "Використати цю модель для поточного сеансу Hermes."choice_cancel: "Скасувати"diff --git a/locales/zh-hant.yaml b/locales/zh-hant.yamlindex 1f7e08e6978..7784dbecb50 100644--- a/locales/zh-hant.yaml+++ b/locales/zh-hant.yaml@@ -2012,6 +2012,8 @@ cli:usage_switch_reasoning: "切換並設定推理強度"usage_switch_provider: "切換提供方"usage_refresh: "重新擷取即時模型清單"+ reset_none: "已在使用設定的預設模型({model})— 無需重設。"+ reset_no_default: "config.yaml 中沒有 model.default — 無可重設的目標。"choice_switch_anyway: "仍要切換"desc_switch_anyway: "在目前的 Hermes 工作階段使用此模型。"choice_cancel: "取消"diff --git a/locales/zh.yaml b/locales/zh.yamlindex 0e874cdb6b2..0b494c5a735 100644--- a/locales/zh.yaml+++ b/locales/zh.yaml@@ -2012,6 +2012,8 @@ cli:usage_switch_reasoning: "切换并设置推理强度"usage_switch_provider: "切换提供方"usage_refresh: "重新获取实时模型列表"+ reset_none: "已在使用配置的默认模型({model})— 无需重置。"+ reset_no_default: "config.yaml 中没有 model.default — 没有可重置的目标。"choice_switch_anyway: "仍然切换"desc_switch_anyway: "在当前 Hermes 会话中使用此模型。"choice_cancel: "取消"diff --git a/tests/gateway/test_model_reset_command.py b/tests/gateway/test_model_reset_command.pynew file mode 100644index 00000000000..f3c9547f4d8--- /dev/null+++ b/tests/gateway/test_model_reset_command.py@@ -0,0 +1,56 @@+"""Gateway ``/model reset``: a persisted session override is cleared without losing the chat."""++import json+from types import SimpleNamespace++import pytest++from gateway.config import GatewayConfig, Platform+from gateway.platforms.event import MessageEvent, MessageType+from gateway.run import GatewayRunner+from gateway.session import SessionSource, SessionStore, build_session_key+++def _event(text: str, source: SessionSource) -> MessageEvent:+ return MessageEvent(text=text, message_type=MessageType.TEXT, source=source)+++async def test_reset_clears_a_persisted_override_after_restart(tmp_path, monkeypatch):+ import gateway.run as gateway_run++ home = tmp_path / "home"+ home.mkdir()+ # JSON is valid YAML; CI ships no pyyaml for test fixtures.+ (home / "config.yaml").write_text(json.dumps({"model": {"default": "cfg-model", "provider": "cfg-prov"}}))+ monkeypatch.setattr(gateway_run, "_hermes_home", home)++ source = SessionSource(platform=Platform.TELEGRAM, chat_id="c1", user_id="u1", chat_type="dm")+ key = build_session_key(source)+ store = SessionStore(tmp_path / "sessions", GatewayConfig())+ store.get_or_create_session(source)+ store.set_model_override(key, {"model": "pinned-model", "provider": "pinned-prov"})++ # A fresh runner: the override exists only in the store, as after a gateway restart.+ runner = object.__new__(GatewayRunner)+ runner.config = SimpleNamespace(multiplex_profiles=False)+ runner.session_store = store+ runner._session_db = None+ evicted = []+ runner._evict_cached_agent = lambda k, **_kw: evicted.append(k)+ runner._normalize_source_for_session_key = lambda s: s+ runner._session_key_for_source = lambda s: build_session_key(s)+ runner._pending_one_turn_model_restores[key] = {"had_override": False, "override": None}++ reply = await runner._handle_model_command(_event("/model reset", source))++ assert "cfg-model" in reply+ assert store.get_model_override(key) is None+ assert runner._session_model_overrides.get(key) is None+ assert runner._pending_one_turn_model_restores.get(key) is None # an armed --once can't re-plant it+ assert evicted == [key]+ assert "pinned-model" in runner._pending_model_notes[key]++ again = await runner._handle_model_command(_event("/model reset", source))+ assert again != reply and "cfg-model" in again # nothing left to clear: the "none active" copy+ assert evicted == [key]diff --git a/tests/hermes_cli/test_model_switch_parsing.py b/tests/hermes_cli/test_model_switch_parsing.pyindex 45f2e50bd76..cbf5763aa4e 100644--- a/tests/hermes_cli/test_model_switch_parsing.py+++ b/tests/hermes_cli/test_model_switch_parsing.py@@ -3,6 +3,7 @@from hermes_cli.model_switch import (MODEL_SWITCH_ERR_ONCE_WITH_GLOBAL,+ MODEL_SWITCH_ERR_RESET_WITH_FLAGS,MODEL_SWITCH_ERROR_TEXT,parse_model_switch_args,)@@ -32,3 +33,13 @@ def test_once_with_global_conflict():req = parse_model_switch_args("sonnet --once --global")assert MODEL_SWITCH_ERR_ONCE_WITH_GLOBAL in req.errorsassert MODEL_SWITCH_ERROR_TEXT[MODEL_SWITCH_ERR_ONCE_WITH_GLOBAL] in req.error_messages()+++def test_reset_is_its_own_request_and_takes_no_flags():+ assert parse_model_switch_args(" Reset ").is_reset+ for raw in ("reset --global", "reset --once", "reset --provider nous", "reset --reasoning high"):+ req = parse_model_switch_args(raw)+ assert req.errors == (MODEL_SWITCH_ERR_RESET_WITH_FLAGS,) and not req.is_reset, raw+ # "default" is MoA's preset name; a qualified slug reaches a model whose bare id is "reset".+ for raw in ("default", "my-reset", "vendor/reset", "vendor:reset"):+ assert not parse_model_switch_args(raw).is_reset, rawdiff --git a/tests/tui_gateway/test_model_reset.py b/tests/tui_gateway/test_model_reset.pynew file mode 100644index 00000000000..74dfd7996aa--- /dev/null+++ b/tests/tui_gateway/test_model_reset.py@@ -0,0 +1,45 @@+"""TUI gateway ``/model reset`` (``config.set model`` and Desktop's slash mirror both land here)."""++import json+from types import SimpleNamespace++from tui_gateway import server+++class _Agent:+ def __init__(self):+ self.model, self.provider, self.base_url, self.api_key, self.api_mode = "pinned", "pin-prov", "", "", ""+ self.switched_to = []++ def switch_model(self, **kw):+ self.switched_to.append((kw["new_model"], kw["new_provider"]))+ self.model, self.provider = kw["new_model"], kw["new_provider"]+++def test_reset_drops_the_pin_and_adopts_config_without_repinning(monkeypatch, tmp_path):+ (tmp_path / "config.yaml").write_text(json.dumps({"model": {"default": "cfg-model", "provider": "cfg-prov"}}))+ monkeypatch.setattr(server, "_hermes_home", tmp_path)+ resolved = []++ def _switch_model(**kw): # provider resolution is the boundary; record what reset asks for+ resolved.append((kw["raw_input"], kw["explicit_provider"], kw["is_global"]))+ return SimpleNamespace(+ success=True, new_model=kw["raw_input"], target_provider=kw["explicit_provider"], base_url="",+ api_key="k", api_mode="chat_completions", warning_message="", model_info=None, error_message="",+ runtime_capabilities=None, request_overrides=None, usage_notice="")++ monkeypatch.setattr("hermes_cli.model_switch.switch_model", _switch_model)+ agent = _Agent()+ session = {"agent": agent, "model_override": {"model": "pinned", "provider": "pin-prov"},+ "one_turn_model_restore": {"model": "pinned"}, "config_model_seen": ("cfg-model", "cfg-prov")}++ out = server._apply_model_switch("sid", session, "reset")++ assert resolved == [("cfg-model", "cfg-prov", False)] # never persisted to config.yaml+ assert agent.switched_to == [("cfg-model", "cfg-prov")]+ assert "model_override" not in session # no fresh pin: later config edits reach this chat+ assert "one_turn_model_restore" not in session+ assert out["value"] == "cfg-model" and out["scope"] == "session"++ again = server._apply_model_switch("sid", session, "reset")+ assert again["warning"] != out["warning"] and agent.switched_to == [("cfg-model", "cfg-prov")]diff --git a/tui_gateway/methods_config_set.py b/tui_gateway/methods_config_set.pyindex 30104da010c..af2e64490f0 100644--- a/tui_gateway/methods_config_set.py+++ b/tui_gateway/methods_config_set.py@@ -88,7 +88,11 @@ def _stash_pending_model_switch(rid, key, value, session, confirmed, parsed):except Exception:pending_model = str(value)pending_provider = (getattr(parsed, "explicit_provider", "") or "").strip()- if not confirmed:+ is_reset = getattr(parsed, "is_reset", False)+ if is_reset: # `/model reset` queued: show the default it adopts, not the word "reset"+ pending_model, pending_provider = _config_model_target()+ pending_model = pending_model or str(value)+ if not confirmed and not is_reset:# A bare pick resolves against the live provider at turn start; guard on that same provider# here, or a provider-keyed price check passes now and drops the queued pick later.agent = session.get("agent")diff --git a/website/docs/reference/slash-commands.md b/website/docs/reference/slash-commands.mdindex 176a8fb91a7..8c361c11391 100644--- a/website/docs/reference/slash-commands.md+++ b/website/docs/reference/slash-commands.md@@ -77,7 +77,7 @@ Type `/` in the CLI to open the autocomplete menu. Built-in commands are case-in| Command | Description ||---------|-------------|| `/config` | Show current configuration |-| `/model [model-name]` | Show or change the current model. Supports: `/model claude-sonnet-4`, `/model provider:model` (switch providers), `/model custom:model` (custom endpoint), `/model custom:name:model` (named custom provider), `/model custom` (auto-detect from endpoint), OpenRouter account presets (`/model @preset/<slug>` or `/model <model>@preset/<slug>` — presets are account-scoped, so they skip the public model-listing check), and user-defined aliases (`/model fav`, `/model grok` — see [Custom model aliases](#custom-model-aliases)). Flags: `--global` persists the change to config.yaml; `--session` forces session-only; `--once` applies to the next turn only; `--refresh` re-fetches the provider's model list; `--provider <name>` switches backend (session-only unless `--global`); `--reasoning <level>` sets the reasoning effort (`none`, `minimal` … `ultra`) in the same step and with the same scope as the pick. A plain `/model <name>` is session-only unless `model.persist_switch_by_default: true` is set — except when no `model.default`/`model.provider` is configured yet, in which case the first pick persists so the profile gets a real default. The same rule governs the desktop composer picker. **Interactive picker:** running `/model` with no arguments opens the provider→model picker; on the model list you can **type to fuzzy-filter** the models (e.g. type `grok` to narrow to matching models), Backspace to trim the filter, Esc to clear it (or close the picker). Selection always resolves to one concrete model — the filter only narrows the list, it never guesses. After the model, a third step offers the reasoning effort for that model (or **Keep current effort**); it is skipped when the catalog says the route has no reasoning control. **Note:** `/model` can only switch between already-configured providers. To add a new provider, exit the session and run `hermes model` from your terminal. **Cost note:** switching models mid-conversation resets the prompt cache — the cache key includes the model, so your next turn re-reads the entire conversation at full input price instead of the ~75%-discounted cached rate. Expected and unavoidable, but worth knowing on long sessions. |+| `/model [model-name]` | Show or change the current model. Supports: `/model claude-sonnet-4`, `/model provider:model` (switch providers), `/model custom:model` (custom endpoint), `/model custom:name:model` (named custom provider), `/model custom` (auto-detect from endpoint), OpenRouter account presets (`/model @preset/<slug>` or `/model <model>@preset/<slug>` — presets are account-scoped, so they skip the public model-listing check), and user-defined aliases (`/model fav`, `/model grok` — see [Custom model aliases](#custom-model-aliases)). Flags: `--global` persists the change to config.yaml; `--session` forces session-only; `--once` applies to the next turn only; `--refresh` re-fetches the provider's model list; `--provider <name>` switches backend (session-only unless `--global`); `--reasoning <level>` sets the reasoning effort (`none`, `minimal` … `ultra`) in the same step and with the same scope as the pick. `/model reset` (no flags) drops this session's pick and goes back to `config.yaml`'s model without losing the conversation. A plain `/model <name>` is session-only unless `model.persist_switch_by_default: true` is set — except when no `model.default`/`model.provider` is configured yet, in which case the first pick persists so the profile gets a real default. The same rule governs the desktop composer picker. **Interactive picker:** running `/model` with no arguments opens the provider→model picker; on the model list you can **type to fuzzy-filter** the models (e.g. type `grok` to narrow to matching models), Backspace to trim the filter, Esc to clear it (or close the picker). Selection always resolves to one concrete model — the filter only narrows the list, it never guesses. After the model, a third step offers the reasoning effort for that model (or **Keep current effort**); it is skipped when the catalog says the route has no reasoning control. **Note:** `/model` can only switch between already-configured providers. To add a new provider, exit the session and run `hermes model` from your terminal. **Cost note:** switching models mid-conversation resets the prompt cache — the cache key includes the model, so your next turn re-reads the entire conversation at full input price instead of the ~75%-discounted cached rate. Expected and unavoidable, but worth knowing on long sessions. || `/codex-runtime [auto\|codex_app_server\|on\|off]` | Toggle the optional [Codex app-server runtime](../user-guide/features/codex-app-server-runtime) for OpenAI/Codex models and named custom providers that are also defined in `~/.codex/config.toml`. `auto` (default) uses Hermes' standard chat completions; `codex_app_server` hands eligible turns to a `codex app-server` subprocess for native shell, apply_patch, ChatGPT subscription auth, and migrated Codex plugins. Effective on next session. || `/personality` | Set a predefined personality. `/personality none` (or `default` / `neutral`) clears the overlay and returns to base behavior. || `/verbose` | Cycle tool progress display: off → new → all → verbose. Can be [enabled for messaging](#notes) via config. |@@ -249,7 +249,7 @@ The messaging gateway supports the following built-in commands inside Telegram,| `/stop` | Kill all running background processes and interrupt the running agent. || `/discard` | Drop a turn Hermes lost in a restart so this chat's queued messages run again. The lost turn is not re-run (only you know whether to send it again); it is recorded as interrupted. Hermes offers this when it pauses a conversation on a lost turn. On Slack use `/hermes discard`. || `/pause [reason \| off]` | Global emergency stop, the in-chat form of [`hermes pause`](./cli-commands.md): puts new cron, kanban and gateway work on hold until `/pause off`. In-flight work finishes normally, and slash commands keep working while paused, so a messaging-only operator can always lift it. |-| `/model [provider:model]` | Show or change the model. Supports provider switches (`/model zai:glm-5`), custom endpoints (`/model custom:model`), named custom providers (`/model custom:local:qwen`), auto-detect (`/model custom`), OpenRouter account presets (`/model @preset/<slug>` — account-scoped, skips the public model-listing check), and user-defined aliases (`/model fav`, `/model grok` — see [Custom model aliases](#custom-model-aliases)). Use `--global` to persist the change to config.yaml; a successful `--global` pick (typed or picker) also drops this chat's session-only override, so config.yaml alone decides the model after a gateway restart (a chat with a `channel_overrides` model keeps the override, since the channel setting would otherwise outrank config.yaml; the CLI/TUI deliberately keep their per-session pin so resume restores the model that chat used). **Note:** `/model` can only switch between already-configured providers. To add a new provider or set up API keys, use `hermes model` from your terminal (outside the chat session). **Cost note:** a mid-session model switch resets the prompt cache (the cache key includes the model), so the next message re-reads the whole conversation at full input price. |+| `/model [provider:model]` | Show or change the model. Supports provider switches (`/model zai:glm-5`), custom endpoints (`/model custom:model`), named custom providers (`/model custom:local:qwen`), auto-detect (`/model custom`), OpenRouter account presets (`/model @preset/<slug>` — account-scoped, skips the public model-listing check), and user-defined aliases (`/model fav`, `/model grok` — see [Custom model aliases](#custom-model-aliases)). `/model reset` clears this chat's session override (memory, the persisted copy, and any pending `--once` restore) so `channel_overrides` / config.yaml decide the model again, keeping the conversation. Use `--global` to persist the change to config.yaml; a successful `--global` pick (typed or picker) also drops this chat's session-only override, so config.yaml alone decides the model after a gateway restart (a chat with a `channel_overrides` model keeps the override, since the channel setting would otherwise outrank config.yaml; the CLI/TUI deliberately keep their per-session pin so resume restores the model that chat used). **Note:** `/model` can only switch between already-configured providers. To add a new provider or set up API keys, use `hermes model` from your terminal (outside the chat session). **Cost note:** a mid-session model switch resets the prompt cache (the cache key includes the model), so the next message re-reads the whole conversation at full input price. || `/codex-runtime [auto\|codex_app_server\|on\|off]` | Toggle the optional [Codex app-server runtime](../user-guide/features/codex-app-server-runtime). Persists to `model.openai_runtime` in config.yaml and evicts the cached agent so the next message picks up the new runtime. Effective on next session. || `/personality [name]` | Set a personality overlay for the session. `/personality none` (or `default` / `neutral`) clears it. || `/fast [normal\|fast\|auto\|cold\|status]` | Fast mode — OpenAI Priority Processing / Anthropic Fast Mode. `auto`/`cold` open a bounded fast window per turn / per session. |diff --git a/website/docs/user-guide/messaging/index.md b/website/docs/user-guide/messaging/index.mdindex 2e832d57ae2..4ae9870408a 100644--- a/website/docs/user-guide/messaging/index.md+++ b/website/docs/user-guide/messaging/index.md@@ -275,7 +275,7 @@ Sessions persist across messages until they reset. The agent remembers your conv### Persistent `/model` Overrides-A `/model` switch in a gateway chat applies to that session and now **survives gateway restarts**: the model/provider choice is persisted to the session store and rehydrated on first use after a restart (credentials are re-resolved at load time and never written to disk). `/new` (or `/reset`) clears the override, and `/model <name> --global` writes it through to `config.yaml` instead. `/model <name> --once` applies for a single turn only.+A `/model` switch in a gateway chat applies to that session and now **survives gateway restarts**: the model/provider choice is persisted to the session store and rehydrated on first use after a restart (credentials are re-resolved at load time and never written to disk). `/model reset` clears the override and keeps the conversation, `/new` (or `/reset`) clears it with a fresh conversation, and `/model <name> --global` writes it through to `config.yaml` instead. `/model <name> --once` applies for a single turn only.### Delivery Reliability