refactor(agent/compression): try/except-pass -> contextlib.suppress (21 sites)

This commit is contained in:
Teknium
2026-09-02 19:24:14 -07:00
parent 7bd7c1114a
commit 4fc0d74fe3
2 changed files with 23 additions and 63 deletions
+2 -3
View File
@@ -5,6 +5,7 @@ timeout, mirrors ``_DB_PERSISTED_MARKER`` stamps back onto the live lists and re
Extracted from ``run_agent.py``; every method resolves through ``AIAgent``'s MRO unchanged.
"""
import contextlib
import logging
import copy
import threading
@@ -202,12 +203,10 @@ def _rebind_caller_session_context(agent) -> None:
The worker thread rotated hermes_logging's thread-local id; post-compression tools must
resolve HERMES_SESSION_ID to the child id.
"""
try:
with contextlib.suppress(Exception):
from hermes_logging import set_session_context
set_session_context(agent.session_id)
except Exception:
pass
try:
from gateway.session_context import set_current_session_id