fix(honcho): drop unread _client_slot_timeouts bookkeeping
The dict was written on every build and popped/cleared on eviction and reset, but no read site remained — timeout staleness detection moved into the cache key itself (a timeout change produces a new identity and _slot_for evicts the old slot), which the isolation tests already pin. Flagged in review by @spfcraze.
This commit is contained in:
@@ -885,7 +885,6 @@ _honcho_client_slot: SingletonSlot = SingletonSlot()
|
||||
import threading as _threading
|
||||
|
||||
_client_slots: dict[tuple, SingletonSlot] = {}
|
||||
_client_slot_timeouts: dict[tuple, float] = {}
|
||||
_client_slots_lock = _threading.Lock()
|
||||
|
||||
|
||||
@@ -1017,7 +1016,6 @@ def _slot_for(key: tuple) -> SingletonSlot:
|
||||
]
|
||||
for k in stale:
|
||||
_client_slots.pop(k, None)
|
||||
_client_slot_timeouts.pop(k, None)
|
||||
slot = SingletonSlot()
|
||||
_client_slots[key] = slot
|
||||
return slot
|
||||
@@ -1285,8 +1283,6 @@ def get_honcho_client(config: HonchoClientConfig | None = None) -> Honcho:
|
||||
if resolved_timeout is not None:
|
||||
kwargs["timeout"] = resolved_timeout
|
||||
|
||||
with _client_slots_lock:
|
||||
_client_slot_timeouts[key] = resolved_timeout
|
||||
return Honcho(**kwargs)
|
||||
|
||||
return slot.get(_build)
|
||||
@@ -1296,6 +1292,5 @@ def reset_honcho_client() -> None:
|
||||
"""Reset all cached Honcho clients (tests, OAuth re-login)."""
|
||||
with _client_slots_lock:
|
||||
_client_slots.clear()
|
||||
_client_slot_timeouts.clear()
|
||||
_honcho_client_slot.reset()
|
||||
_honcho_json_timeout_memo.clear()
|
||||
|
||||
@@ -12,12 +12,13 @@ exclude-newer = "0001-01-01T00:00:00Z" # This has no effect and is included for
|
||||
exclude-newer-span = "P14D"
|
||||
|
||||
[options.exclude-newer-package]
|
||||
h2 = false
|
||||
vercel = false
|
||||
aiohttp = false
|
||||
cryptography = false
|
||||
nemo-relay = false
|
||||
huggingface-hub = false
|
||||
h2 = false
|
||||
honcho-ai = { timestamp = "0001-01-01T00:00:00Z", span = "PT0S" }
|
||||
|
||||
[manifest]
|
||||
overrides = [
|
||||
|
||||
Reference in New Issue
Block a user