hermes-agent/tests/honcho_plugin
Erosika 7a26fb3436 feat(honcho): SyncWorker + HonchoLatencyTracker + CircuitBreaker primitives
Foundational building blocks for the Honcho sync path rework.  Provider
integration lands in a follow-up commit; this commit is standalone unit-
tested primitives that expose clean seams for the integration tests:

  SyncWorker
    Persistent daemon thread draining a bounded task queue.  Replaces
    the per-turn threading.Thread(target=_sync).start() pattern so
    sync_turn() returns immediately, never coordinating thread handoff
    on the user-facing path.  Queue overflow drops the OLDEST task
    (with on_failure callback) rather than blocking the producer —
    preserves responsiveness under load.

  HonchoLatencyTracker
    Rolling p95 observer with a warmup phase (returns default until
    N samples collected) and a floor.  timeout() = max(floor, headroom
    * p95).  Hosted Honcho settles to ~1-3s; self-hosted cold starts
    scale up naturally.  No hardcoded 30s ceiling visible to users.

  CircuitBreaker
    Closed → Open after N consecutive failures.  Probe interval lets
    Open → HalfOpen one request through; success closes, failure
    reopens.  Thread-safe.  Time source is injectable for determinism
    in tests.

24 tests covering all three primitives plus their integration (worker
feeds latency observations to the tracker and success/failure to the
breaker; breaker-open enqueue drops the task via on_failure).

No behavioural change to runtime yet — nothing in the codebase
imports these primitives in this commit.
2026-04-24 18:50:32 -04:00
..
__init__.py feat(memory): pluggable memory provider interface with profile isolation, review fixes, and honcho CLI restoration (#4623) 2026-04-02 15:33:51 -07:00
test_async_memory.py fix(honcho): dialectic lifecycle — defaults, retry, prewarm consumption 2026-04-18 22:50:55 -07:00
test_cli.py style(honcho): hoist hashlib import; validate baseUrl scheme before 'local' sentinel 2026-04-24 18:48:10 -04:00
test_client.py fix(plugins/memory/honcho): default Honcho SDK HTTP timeout to 30s 2026-04-24 18:48:10 -04:00
test_pin_peer_name.py fix(honcho): pinPeerName opt-in keeps memory unified across platforms (#14984) 2026-04-24 18:48:10 -04:00
test_session.py fix: harden memory-context leak boundaries 2026-04-24 18:48:10 -04:00
test_sync_worker.py feat(honcho): SyncWorker + HonchoLatencyTracker + CircuitBreaker primitives 2026-04-24 18:50:32 -04:00