mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-11-06 13:26:40 +00:00
The drain's retry cap drops a watch notice after its last refusal; the warning now says the output stays available via process(action='log'), as the gone-pin drop and the completion pre-flight already do. Tests: assert the backoff doubles to its cap instead of only a lower bound; move the transport-retry test's clock a minute per watcher tick rather than per read, which also drove the orphan-sweep throttle; cover a refused notice with no pinned session (requeued, never dropped). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
25 lines
743 B
Python
25 lines
743 B
Python
"""One module's view of ``time`` with a test-driven ``monotonic``.
|
|
|
|
Patching ``time.monotonic`` itself also moves the running event loop's clock (its timers read the
|
|
same function); this swaps only the module's ``time`` binding, so the loop keeps real time."""
|
|
import time
|
|
|
|
|
|
class ModuleClock:
|
|
"""``time`` for one module, except that ``monotonic()`` returns ``now``."""
|
|
|
|
def __init__(self, now: float):
|
|
self.now = now
|
|
|
|
def monotonic(self) -> float:
|
|
return self.now
|
|
|
|
def __getattr__(self, name):
|
|
return getattr(time, name)
|
|
|
|
|
|
def install_module_clock(monkeypatch, module, *, now: float = 1000.0) -> ModuleClock:
|
|
clock = ModuleClock(now)
|
|
monkeypatch.setattr(module, "time", clock)
|
|
return clock
|