From 046c58879c9ff0f2fb4c32d23560d53a050df15e Mon Sep 17 00:00:00 2001 From: CD Date: Sat, 7 Mar 2026 14:31:14 +0900 Subject: [PATCH] fix: periodic register reload in approval scanner + direct project_name access --- bot.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/bot.py b/bot.py index 22ea0f8..9b246b8 100644 --- a/bot.py +++ b/bot.py @@ -322,8 +322,11 @@ class GravityBot(commands.Bot): @tasks.loop(seconds=3) async def pending_approval_scanner(self): - """Scan bridge/pending/ for new approval requests.""" + """Scan bridge/pending/ for new approval requests + reload registrations.""" try: + # Reload conv→project registrations each cycle + self._load_registrations() + requests = self.bridge.get_pending_requests() for req in requests: if req.request_id in self._sent_approval_ids: @@ -332,7 +335,7 @@ class GravityBot(commands.Bot): continue # Learn project mapping from pending approval - project = getattr(req, 'project_name', '') or Config.PROJECT_NAME + project = req.project_name or Config.PROJECT_NAME if req.conversation_id and req.conversation_id != '__global__': self.conv_to_project[req.conversation_id] = project