hermes-agent/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
..
assets
builtin_hooks
platforms refactor(gateway): route session event stream through _sse_frame (ensure_ascii=False) 2026-08-04 13:07:44 +05:30
relay fix(gateway): bound go_dormant ws.close with teardown timeout 2026-08-04 11:17:11 +05:30
__init__.py
authz_mixin.py fix(secrets): route authz gate and pairing allowlist reads through the profile secret scope 2026-08-02 10:02:33 -07:00
cgroup_cleanup.py
channel_directory.py feat(gateway): simplex channel enumeration + show configured platforms in hermes send --list 2026-08-02 15:08:45 -07:00
code_skew.py
config.py
cwd_placeholder.py
dead_targets.py
delivery.py
delivery_ledger.py
display_config.py
drain_control.py
hooks.py
kanban_watchers.py fix: use lazy logging with %s formatting in logger calls 2026-08-02 23:17:40 +05:30
lifecycle_ledger.py
memory_monitor.py
message_timestamps.py
mirror.py
pairing.py fix(secrets): route authz gate and pairing allowlist reads through the profile secret scope 2026-08-02 10:02:33 -07:00
platform_registry.py
profile_routing.py
readiness.py
response_filters.py
restart.py fix(gateway): defer in-band restart until active turns finish (#77184) 2026-08-03 09:57:58 +05:30
restart_loop_guard.py
rich_sent_store.py
run.py refactor(gateway): extract the hygiene recovery gate and forward the failure reason 2026-08-06 15:04:53 +05:30
runtime_footer.py feat(gateway): add opt-in 'latency' runtime footer field 2026-08-03 17:16:57 +05:30
scale_to_zero.py
session.py fix(tests): fail hard when pytest resolves the production state.db (live-DB isolation guard) 2026-08-06 07:49:50 -07:00
session_context.py fix(cron): scope cron approval context per session 2026-08-03 00:25:20 +05:30
session_stall.py feat(gateway): session activity watchdog, stall notify, compress timeout (#72424) 2026-08-02 16:16:36 -07:00
session_state.py refactor(gateway): extract the hygiene recovery gate and forward the failure reason 2026-08-06 15:04:53 +05:30
shutdown_flush.py
shutdown_forensics.py
shutdown_watchdog.py
slash_access.py
slash_commands.py feat: /model reset — clear a session's model pin without losing history (NS-563) 2026-08-06 09:11:21 -07:00
status.py
status_phrases.py
sticker_cache.py
stream_consumer.py fix(gateway): don't claim deleted head chunks as delivered in the empty-fallback recovery 2026-08-06 03:13:32 +05:30
stream_dispatch.py
stream_events.py
streaming_tts_consumer.py
systemd_notify.py
turn_context.py
turn_lease.py
wake.py
whatsapp_identity.py