This commit is contained in:
2026-01-31 19:57:09 -08:00
parent 6513a3ad04
commit 1dbaabac73
7 changed files with 125 additions and 88 deletions

View File

@@ -12,6 +12,8 @@ from __future__ import annotations
from typing import Any, Callable, Dict, Optional, Set
from SYS.logger import log, debug
import logging
logger = logging.getLogger(__name__)
class BackgroundNotifier:
@@ -103,7 +105,7 @@ class BackgroundNotifier:
try:
self.output(line)
except Exception:
pass
logger.exception("BackgroundNotifier failed to output overlay line for worker %s", worker_id)
self._last_state.pop(worker_id, None)
self.session_worker_ids.discard(worker_id)
@@ -120,7 +122,7 @@ class BackgroundNotifier:
try:
self.output(line)
except Exception:
pass
logger.exception("BackgroundNotifier failed to output terminal-only line for worker %s", worker_id)
# Stop tracking this worker after terminal notification
self.session_worker_ids.discard(worker_id)
continue
@@ -148,7 +150,7 @@ class BackgroundNotifier:
try:
self.output(line)
except Exception:
pass
logger.exception("BackgroundNotifier failed to output line for worker %s", worker_id)
if self.overlay_mode:
try:
@@ -156,7 +158,7 @@ class BackgroundNotifier:
if overlay_active_workers == 0:
self.output("")
except Exception:
pass
logger.exception("BackgroundNotifier failed to clear overlay for session")
def ensure_background_notifier(
@@ -201,6 +203,6 @@ def ensure_background_notifier(
)
try:
manager._background_notifier = notifier # type: ignore[attr-defined]
except Exception:
pass
except Exception as exc:
logger.exception("Failed to attach background notifier to manager: %s", exc)
return notifier