fix(cli): retire the 0.0 monotonic sentinel in the remaining input-mode throttles

Review follow-up on #91651: _recover_terminal_input_modes and the termios
drift check used the same `now - 0.0 < interval` idiom as the repaint
throttles. Their windows (0.5s / 1.0s) are unreachable in practice, but
converting them to the None sentinel retires the bug class instead of the
instance, so nobody "simplifies" a None back to 0.0 later. Also adds the
missing regression test for _invalidate, the throttle the PR title is about.
This commit is contained in:
teknium1
2026-09-14 18:15:56 -07:00
committed by Teknium
parent eab377a407
commit e43f2f6816
3 changed files with 20 additions and 4 deletions
+1 -1
View File
@@ -2635,7 +2635,7 @@ class HermesCLI(CLIProcessNotificationsMixin, CLIAgentSetupMixin, CLICommandsMix
self._stream_table_buf: list[str] = []
self._in_stream_table = False
self._pending_edit_snapshots = {}
self._last_input_mode_recovery = self._last_termios_drift_check = 0.0
self._last_input_mode_recovery = self._last_termios_drift_check = None # None = never; monotonic epoch is arbitrary
self._input_mode_recovery_notice_shown = self._termios_drift_notice_shown = False
def _init_model_routing(self, model, toolsets, provider, reasoning, api_key, base_url, max_turns, run_budget, checkpoints, pass_session_id, ignore_rules):