From c1b7f28693ece474f27c3346c047610448d7c6a9 Mon Sep 17 00:00:00 2001 From: teknium1 <127238744+teknium1@users.noreply.github.com> Date: Mon, 14 Sep 2026 17:52:22 -0700 Subject: [PATCH] test(local-runtime): trim idle-probe salvage to two invariants MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Keep the two tests that were red on origin/main (probe failure keeps the clock and unloads once telemetry recovers; confirmed busy still resets). Drop the is_idle() bool contract test — it pins behaviour that did not change — and fold the probe-failure log call onto two lines. --- hermes_cli/local_runtime/supervisor.py | 8 ++------ tests/hermes_cli/test_local_runtime.py | 13 ------------- 2 files changed, 2 insertions(+), 19 deletions(-) diff --git a/hermes_cli/local_runtime/supervisor.py b/hermes_cli/local_runtime/supervisor.py index 768bc8f058..0688d3debc 100644 --- a/hermes_cli/local_runtime/supervisor.py +++ b/hermes_cli/local_runtime/supervisor.py @@ -390,12 +390,8 @@ class LlamaServerSupervisor: continue probe = self._probe_idle(model_id) if probe is None: - idle_for = int(now - self._idle_since.get(model_id, now)) - logger.info( - "idle probe for %s failed; keeping idle clock (idle %ds)", - model_id, - idle_for, - ) + logger.info("idle probe for %s failed; keeping idle clock (idle %ds)", model_id, + int(now - self._idle_since.get(model_id, now))) continue if probe is False: self._idle_since.pop(model_id, None) diff --git a/tests/hermes_cli/test_local_runtime.py b/tests/hermes_cli/test_local_runtime.py index 71065b8b98..93c5930cc6 100644 --- a/tests/hermes_cli/test_local_runtime.py +++ b/tests/hermes_cli/test_local_runtime.py @@ -645,19 +645,6 @@ def test_idle_sweep_busy_after_probe_failure_still_resets_clock( assert handler.unloaded == [] -def test_is_idle_probe_failure_reports_not_idle(stub_server, tmp_path): - """The public bool contract is unchanged: a failed probe reads as "not idle" — - callers outside the sweep never unload on a telemetry hiccup.""" - port, handler = stub_server - sup = _make_supervisor(tmp_path, port) - handler.models = {"data": [{"id": "m", "status": {"value": "loaded"}}]} - handler.slots = [] - handler.metrics_error = 503 - assert sup.is_idle() is False - handler.metrics_error = 0 - assert sup.is_idle() is True - - def test_staged_models_requires_every_split_part(tmp_path, monkeypatch): """A split GGUF mid-download must NOT count as staged: the picker, the catalog's 'downloaded' flag, and the router's model list all read