hermes-agent/tui_gateway
Shannon Sands f94425e586
feat: /model reset — clear a session's model pin without losing history (NS-563)
A session-scoped /model switch pins the session to that model. The pin is
durable: the gateway persists it via SessionStore.set_model_override and
re-applies it on restart (_rehydrate_session_model_override); the TUI
persists session["model_override"] to the session DB row and restores it
on resume. Changing the global default (dashboard 'main model', config.yaml,
or /model --global) therefore never moves pinned sessions, and before this
change the only escape was /new — throwing away the conversation (NS-563:
'bot stuck on deepseek even after switching model and restarting').

/model reset clears the session pin and returns to the configured default
while keeping history:

- hermes_cli/model_switch.py: single-owner parser recognizes reset|default|
  clear targets (MODEL_SWITCH_RESET_TOKENS), rejects flag combinations
  (MODEL_SWITCH_ERR_RESET_WITH_FLAGS), and exposes is_model_reset_request()
  so every surface shares one definition.
- gateway/slash_commands.py: _handle_model_reset clears the in-memory
  override, the persisted DB override, and a queued one-turn restore;
  evicts the cached agent so the next turn resolves fresh; reports the
  now-active default. Listed in /model usage help.
- tui_gateway/server.py: _reset_session_model_override clears the pin +
  one-turn restore, re-adopts the config default through the normal
  switch path (never creating a fresh pin, never persisting), and
  persists the cleared row so session.resume can't resurrect the pin.
- cli.py: _handle_model_reset_command re-derives the config.yaml default
  (fresh read, not the startup snapshot) and switches back session-scoped;
  clears a pending one-turn restore.
- locales/en.yaml: usage_reset/reset_done/reset_none strings.

Tests: parser-level reset detection, gateway handler behavior (clear +
persist + evict + no-op), TUI reset semantics (pin cleared, adopt-sync
rerun, no fresh pin, resume-safe persist), CLI reset (switch-back,
restore-queue cleared, no-op on default, never persists config).
2026-08-06 09:11:21 -07:00
..
__init__.py
_stdin_recovery.py
compute_host.py docs: note atexit re-finalization interaction in shutdown() docstring 2026-08-03 09:59:58 +05:30
entry.py perf(gateway): prewarm /model picker cache on TUI startup 2026-08-04 12:28:05 +05:30
event_publisher.py
git_probe.py
host_supervisor.py
loop_noise.py
method_ctx.py refactor(tui): split @method handlers into methods_* modules (mechanical move, registry set-equality verified) 2026-07-29 11:46:31 -07:00
methods_complete.py feat(tui): rank the slash menu by the skills you actually use 2026-08-01 01:17:41 -05:00
methods_config.py fix(tui): rebind extracted config handler to shared indicator constants 2026-07-31 22:33:16 -07:00
methods_prompt.py Hermes can read the in-app browser (#79482) 2026-08-05 16:35:00 +00:00
methods_session.py feat(gateway): session.workspace.move — re-home a stored session's workspace 2026-08-04 13:23:00 -06:00
methods_tools.py fix(secrets): scope tier-3 credential reads (teams_pipeline, deepinfra models, FAL/XAI/VERCEL/DAYTONA/GITHUB presence, HERMES_API_KEY display) 2026-08-02 10:04:48 -07:00
project_tree.py
render.py
server.py feat: /model reset — clear a session's model pin without losing history (NS-563) 2026-08-06 09:11:21 -07:00
slash_worker.py polish(mem): readonly config read, debug-level trim logs, loud frame test 2026-08-02 22:44:38 +05:30
synthetic_turn.py
transport.py
turn_marker.py
ws.py perf(cold-start): mitigate ~14s GIL stall during backend init (#60800) 2026-08-03 21:16:09 +05:30