Teknium
8b6931393e
Port from langchain-ai/deepagents#5829 : confirm mid-session model switches that abandon a large cached context
...
Providers key prompt caches per model, so a mid-session /model switch makes
the next reply re-read the entire conversation at full input price. deepagents
gates user-initiated switches behind a confirmation once the active thread
exceeds a configurable token threshold; this ports the same protection into
Hermes' unified selection-guard registry so it renders on every surface at
once (CLI/TUI picker, gateway /model, Telegram/Discord pickers, dashboard).
- hermes_cli/model_selection_guards.py: new context_cache guard +
SelectionContext carrier + selection_context_for_agent() helper;
registry threads live-session facts to guards (6-arg signature with a
TypeError fallback for externally patched 5-arg guards).
- config: model.switch_context_confirm_tokens (default 100000, 0 disables).
- cli.py / gateway/slash_commands.py / tui_gateway/server.py: thread the
live agent's measured context into the guard call.
- docs: configuring-models.md mid-session switch section.
- tests: tests/hermes_cli/test_context_cache_switch_guard.py (13 cases).
2026-09-13 20:54:50 -07:00
..
2026-07-05 06:29:26 -07:00
2026-04-28 09:50:27 -07:00
2026-09-13 19:18:26 -07:00
2026-09-13 06:06:46 -07:00
2026-09-07 06:10:54 -07:00
2026-09-02 19:21:46 -07:00
2026-09-13 05:32:38 -07:00
2026-09-13 15:39:11 -07:00
2026-09-10 10:27:07 -07:00
2026-09-03 17:13:22 -07:00
2026-09-03 17:13:22 -07:00
2026-09-02 19:21:46 -07:00
2026-09-03 13:46:50 -07:00
2026-09-02 19:21:46 -07:00
2026-09-13 20:53:54 -07:00
2026-09-12 08:42:58 -07:00
2026-09-12 12:52:19 -07:00
2026-09-12 08:49:16 -07:00
2026-09-02 19:21:46 -07:00
2026-09-02 20:13:08 -07:00
2026-09-13 05:08:29 -07:00
2026-09-07 06:00:05 -07:00
2026-09-04 00:15:16 -07:00
2026-09-02 22:42:55 -07:00
2026-09-03 09:44:26 -07:00
2026-09-11 15:44:00 -07:00
2026-09-03 17:13:22 -07:00
2026-09-03 17:13:22 -07:00
2026-09-03 17:13:22 -07:00
2026-09-03 00:09:14 -07:00
2026-09-13 05:07:11 -07:00
2026-09-13 05:08:29 -07:00
2026-09-04 00:15:16 -07:00
2026-09-13 05:08:29 -07:00
2026-09-11 06:21:48 -07:00
2026-09-03 09:44:26 -07:00
2026-09-13 14:43:19 -07:00
2026-09-13 14:37:17 -07:00
2026-09-13 14:43:19 -07:00
2026-09-02 19:21:46 -07:00
2026-09-11 15:44:00 -07:00
2026-09-11 15:44:00 -07:00
2026-09-02 19:21:46 -07:00
2026-09-02 19:21:46 -07:00
2026-09-04 00:15:16 -07:00
2026-09-02 19:21:46 -07:00
2026-09-12 08:22:42 -07:00
2026-09-13 05:07:11 -07:00
2026-09-03 09:44:26 -07:00
2026-09-11 15:28:00 -07:00
2026-09-03 09:44:26 -07:00
2026-09-03 17:13:22 -07:00
2026-09-03 17:13:22 -07:00
2026-09-03 09:44:26 -07:00
2026-09-13 05:07:11 -07:00
2026-09-13 15:41:01 -07:00
2026-09-12 22:19:44 -07:00
2026-09-11 15:28:00 -07:00
2026-09-02 16:11:50 -07:00
2026-09-13 05:32:38 -07:00
2026-09-11 19:58:07 -07:00
2026-09-07 14:16:57 -07:00
2026-09-07 14:16:57 -07:00
2026-09-12 12:24:24 +05:30
2026-09-13 15:41:01 -07:00
2026-09-13 15:41:01 -07:00
2026-09-13 05:08:20 -07:00
2026-09-12 08:49:16 -07:00
2026-09-13 15:39:11 -07:00
2026-09-13 20:52:02 -07:00
2026-09-13 19:23:09 +05:30
2026-09-13 20:52:02 -07:00
2026-09-11 15:28:00 -07:00
2026-09-07 06:10:54 -07:00
2026-09-13 20:51:06 -07:00
2026-09-02 21:14:22 -07:00
2026-09-04 15:41:27 -03:00
2026-09-09 10:55:32 -07:00
2026-09-02 19:21:38 -07:00
2026-09-13 05:21:02 -07:00
2026-09-13 05:07:11 -07:00
2026-09-13 15:41:01 -07:00
2026-09-03 09:44:26 -07:00
2026-09-12 12:03:39 +05:30
2026-09-13 05:20:26 -07:00
2026-09-13 15:41:01 -07:00
2026-09-03 13:46:50 -07:00
2026-09-07 08:20:09 -07:00
2026-09-03 10:00:07 -07:00
2026-09-03 17:13:22 -07:00
2026-09-10 18:17:22 -07:00
2026-09-11 03:45:33 +05:30
2026-09-13 20:54:50 -07:00
2026-09-13 14:45:10 -07:00
2026-09-13 14:45:41 -07:00
2026-09-13 05:09:06 -07:00
2026-09-03 17:13:22 -07:00
2026-09-02 21:14:22 -07:00
2026-09-13 15:41:01 -07:00
2026-09-11 15:44:00 -07:00
2026-09-08 17:51:35 +10:00
2026-09-02 19:19:38 -07:00
2026-09-13 05:20:26 -07:00
2026-09-08 17:51:35 +10:00
2026-09-08 17:51:35 +10:00
2026-09-04 00:15:16 -07:00
2026-09-02 20:24:52 -07:00
2026-09-09 10:59:52 -07:00
2026-09-03 17:13:22 -07:00
2026-09-07 14:11:18 -07:00
2026-09-12 12:03:39 +05:30
2026-09-09 10:55:32 -07:00
2026-09-03 08:16:44 -07:00