diff --git a/plugin/adapter.py b/plugin/adapter.py index 6336b56..5be65fd 100644 --- a/plugin/adapter.py +++ b/plugin/adapter.py @@ -1669,13 +1669,24 @@ class RocketChatAdapter(BasePlatformAdapter): if not self._crash_forensic_done and not is_reconnect: self._crash_forensic_done = True try: + # P-073: crash_forensics liegt als Flat-Modul im Plugin-Verzeichnis + # (Sibling von adapter.py, NICHT in archivar/). Im Gateway-Kontext + # ist das Plugin-Verzeichnis nicht zuverlässig auf sys.path — der + # bare Import `from crash_forensics import ...` schlägt mit + # ModuleNotFoundError fehl (P-022/P-023-Muster). Expliziter + # sys.path-Eintrag stellt sicher, dass das Modul auffindbar ist. + import sys as _sys + import os as _os + _plugin_dir = _os.path.dirname(_os.path.abspath(__file__)) + if _plugin_dir not in _sys.path: + _sys.path.insert(0, _plugin_dir) from crash_forensics import check_for_predecessor_crash report = await check_for_predecessor_crash() if report: for line in report.splitlines(): logger.info(line) except Exception as _forensic_exc: - logger.debug( + logger.warning( "[rocketchat] Crash-Forensik fehlgeschlagen (nicht blockierend): %s", _forensic_exc, )