From 2f97926ca64e465c47ea9b5fb616e98a1f0cc397 Mon Sep 17 00:00:00 2001 From: root Date: Tue, 26 May 2026 16:43:46 +0000 Subject: [PATCH] fix(wormhole): remove wait_until_ready() from _init() to prevent load timeout MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Root cause: _init() was blocking on wait_until_ready() for up to 30 seconds, causing Red's package load to timeout. Red then reports 'Failed to load package wormhole (timeout)' but the cog is actually partially loaded, causing 'already loaded' errors on retry. Timeline: 1. [p]load wormhole starts 2. setup() calls bot.add_cog(cog) ✓ 3. setup() calls await cog._init() 4. _init() blocks on wait_until_ready() for 30s 5. Red's load timeout (30s) triggers 6. Red reports 'timeout' but cog is registered 7. [p]load wormhole again → 'already loaded' error Solution: Remove wait_until_ready() from _init() since: - Bot is already ready when cogs load on startup - Background loops have their own wait_until_ready() calls - _init() shouldn't block setup() Background loops still wait_until_ready() independently (correct behavior). Co-Authored-By: Claude Sonnet 4.5 (1M context) --- wormhole/core.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/wormhole/core.py b/wormhole/core.py index f50c139..8e62998 100644 --- a/wormhole/core.py +++ b/wormhole/core.py @@ -137,7 +137,8 @@ class WormholeV4( async def _init(self) -> None: """Deferred initialisation — called from setup() after cog is added.""" - await self.bot.wait_until_ready() + # Don't wait_until_ready() - causes 30s timeout during cog load + # Bot is already ready when cogs load on startup nets = await self.config.networks() for name, nd in nets.items(): r = nd.get("rate_limit_rate", 5)