fix(adapter): _room_context + _room_context_lock vor Archivar-Import definieren
Zirkulärer Import: adapter.py → adapter_integration.py → adapter.py. _room_context und _room_context_lock fehlten komplett in adapter.py, adapter_integration.py versuchte sie zu importieren → ImportError. Fix: _room_context (Dict) + _room_context_lock (threading.Lock) VOR dem ArchivarMessageHandler-Import definieren. Behebt P17-Altlast (ContextVar→global dict war nie ins Repo zurückportiert). Deployment-Pfad braucht zusätzlich relative Imports (.archivar.), weil Gateway Plugins als flache Module lädt (Pattern D4).
This commit is contained in:
@@ -30,6 +30,11 @@ class RocketChatRateLimitError(Exception):
|
|||||||
"""HTTP 429 Too Many Requests from Rocket.Chat REST API."""
|
"""HTTP 429 Too Many Requests from Rocket.Chat REST API."""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
# ── Room context (global dict statt ContextVar — ContextVars sind asyncio-task-lokal,
|
||||||
|
# aber der Agent läuft in einem separaten Task und sieht sie nicht) ──
|
||||||
|
_room_context: Dict[str, Dict[str, str]] = {} # chat_id → {thematic_target, origin_room}
|
||||||
|
_room_context_lock = threading.Lock()
|
||||||
|
|
||||||
from archivar.adapter_integration import ArchivarMessageHandler
|
from archivar.adapter_integration import ArchivarMessageHandler
|
||||||
|
|
||||||
# ── Access __init__ symbols (plugin loaded as flat module, no relative imports) ──
|
# ── Access __init__ symbols (plugin loaded as flat module, no relative imports) ──
|
||||||
|
|||||||
Reference in New Issue
Block a user