Commit 316a084747ec

Vincent Demeester <vincent@sbr.pm>
2026-01-14 13:27:49
fix(xmpp): fix slixmpp event loop handling
- Replace bot.process() with proper asyncio event loop - Register required XMPP plugins (service discovery, ping) - Fix AttributeError on bot startup Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent c0a3122
Changed files (1)
modules
xmpp-research-bot
modules/xmpp-research-bot/bot.py
@@ -32,6 +32,10 @@ class ResearchBot(slixmpp.ClientXMPP):
         # Initialize Vertex AI client (uses Application Default Credentials)
         self.client = AnthropicVertex(project_id=project_id, region=region)
 
+        # Register plugins
+        self.register_plugin('xep_0030')  # Service Discovery
+        self.register_plugin('xep_0199')  # XMPP Ping
+
         # Register event handlers
         self.add_event_handler("session_start", self.on_session_start)
         self.add_event_handler("message", self.on_message)
@@ -190,11 +194,14 @@ async def main():
     log.info("Connecting to XMPP server...")
     bot.connect()
 
+    # Process events
     try:
-        await bot.process(forever=True)
+        while True:
+            await asyncio.sleep(1)
     except KeyboardInterrupt:
         log.info("Shutting down...")
         bot.disconnect()
+        await bot.disconnected
 
 
 if __name__ == "__main__":