fix(bridge): v0.3.11 approval flow architecture fix — eliminate double-fire auto-approve, strip 30+ failed RPC strategies, add project_name DEDUP guard
- Remove Extension-side auto-approve (was double-firing with Bot auto-approve) - Strip failed strategies 0A-1 from tryApprovalStrategies (~150 lines) - Keep only Strategy 0-PROTO (proto RPC) + Strategy 2 (clickTrigger) - Add bot.py AUTO-RESOLVED logging for diagnostics - Update known-issues with 3 new entries - Clean deployment: v0.3.8→v0.3.10→v0.3.11
This commit is contained in:
6
bot.py
6
bot.py
@@ -622,6 +622,7 @@ class GravityBot(commands.Bot):
|
||||
# FIX #5: Use _approval_messages as fallback when discord_message_id is 0
|
||||
msg_id = data.get("discord_message_id", 0) or self._approval_messages.get(rid, 0)
|
||||
project = data.get("project_name", Config.PROJECT_NAME)
|
||||
logger.info(f"[AUTO-RESOLVED] rid={rid[:12]} project={project} msg_id={msg_id} cmd='{data.get('command', '')[:60]}'")
|
||||
if msg_id:
|
||||
channel = await self._get_channel(project)
|
||||
if channel:
|
||||
@@ -634,8 +635,11 @@ class GravityBot(commands.Bot):
|
||||
)
|
||||
embed.set_footer(text=f"ID: {rid}")
|
||||
await msg.edit(embed=embed, view=None)
|
||||
logger.info(f"[AUTO-RESOLVED] ✅ Discord message {msg_id} updated")
|
||||
except discord.NotFound:
|
||||
pass
|
||||
logger.warning(f"[AUTO-RESOLVED] Discord message {msg_id} not found")
|
||||
else:
|
||||
logger.warning(f"[AUTO-RESOLVED] No msg_id for rid={rid[:12]} — cannot edit Discord message")
|
||||
f.unlink()
|
||||
self._deferred_ids.pop(rid, None)
|
||||
self._sent_commands.pop(rid, None)
|
||||
|
||||
Reference in New Issue
Block a user