From 79f297834a9b08ad75d1f2babc55513ae2a7baed Mon Sep 17 00:00:00 2001 From: teknium1 <127238744+teknium1@users.noreply.github.com> Date: Sat, 20 Jun 2026 19:57:26 -0700 Subject: [PATCH] fix(gateway): widen cron namespace-collision fix to all migrated adapters #49431 corrected parents[2]->parents[3] for discord + raft only. The same bug existed in slack, whatsapp, and telegram adapters (migrated from gateway/platforms/ in 5600105478): each inserts parents[2] = plugins/ onto sys.path[0], shadowing the real cron/ package with plugins/cron/ so 'import cron.scheduler_provider' raises ModuleNotFoundError on gateway start. Fixes #49410, #49824. --- plugins/platforms/slack/adapter.py | 2 +- plugins/platforms/telegram/adapter.py | 2 +- plugins/platforms/whatsapp/adapter.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/platforms/slack/adapter.py b/plugins/platforms/slack/adapter.py index 274fe61665f..8bc0ed381e5 100644 --- a/plugins/platforms/slack/adapter.py +++ b/plugins/platforms/slack/adapter.py @@ -34,7 +34,7 @@ except ImportError: import sys from pathlib import Path as _Path -sys.path.insert(0, str(_Path(__file__).resolve().parents[2])) +sys.path.insert(0, str(_Path(__file__).resolve().parents[3])) from gateway.config import Platform, PlatformConfig from gateway.platforms.helpers import MessageDeduplicator diff --git a/plugins/platforms/telegram/adapter.py b/plugins/platforms/telegram/adapter.py index 2560f3813de..2a1054b1d2e 100644 --- a/plugins/platforms/telegram/adapter.py +++ b/plugins/platforms/telegram/adapter.py @@ -63,7 +63,7 @@ except ImportError: import sys from pathlib import Path as _Path -sys.path.insert(0, str(_Path(__file__).resolve().parents[2])) +sys.path.insert(0, str(_Path(__file__).resolve().parents[3])) from gateway.config import Platform, PlatformConfig from gateway.platforms.base import ( diff --git a/plugins/platforms/whatsapp/adapter.py b/plugins/platforms/whatsapp/adapter.py index 4f5e16d6581..9e89baff066 100644 --- a/plugins/platforms/whatsapp/adapter.py +++ b/plugins/platforms/whatsapp/adapter.py @@ -178,7 +178,7 @@ def _terminate_bridge_process(proc, *, force: bool = False) -> None: return import sys -sys.path.insert(0, str(Path(__file__).resolve().parents[2])) +sys.path.insert(0, str(Path(__file__).resolve().parents[3])) from gateway.config import Platform, PlatformConfig from gateway.platforms.whatsapp_common import WhatsAppBehaviorMixin