fix(tui): tighten fast-mode support validation

Distinguish missing model from unsupported model before enabling fast mode and cover both cases so config and live agent state remain untouched on invalid fast toggles.
This commit is contained in:
Brooklyn Nicholson
2026-04-27 13:00:11 -05:00
parent 4a08f1015a
commit 4f59510dd4
2 changed files with 40 additions and 2 deletions

View File

@@ -2905,9 +2905,17 @@ def _(rid, params: dict) -> dict:
if nv == "fast":
from hermes_cli.models import resolve_fast_mode_overrides
target_model = getattr(agent, "model", None) if agent is not None else _resolve_model()
target_model = (
getattr(agent, "model", None) if agent is not None else _resolve_model()
)
if not target_model:
return _err(
rid,
4002,
"fast mode is not available without a selected model",
)
overrides = resolve_fast_mode_overrides(target_model)
if not overrides:
if overrides is None:
return _err(
rid,
4002,