-
Notifications
You must be signed in to change notification settings - Fork 2
Description
Problem 1: Permission Check Error
When a user without permissions tries to use /summarize, the bot crashes with:
discord.errors.InteractionResponded: This interaction has already been responded to before
Root Cause
The permission check at summarize.py:295 was using interaction.response.send_message() AFTER the interaction was already deferred in commands.py:79.
Fix
Changed to interaction.followup.send() which is the correct method to use after deferral.
Problem 2: OpenRouter 404 Errors
Continuous 404 errors in logs from OpenRouter API:
HTTP Request: POST https://openrouter.ai/api/v1/messages "HTTP/1.1 404 Not Found"
Root Cause
The code wasn't explicitly handling anthropic.NotFoundError, so it was being caught by the generic exception handler without proper logging or context.
Fix
Added explicit NotFoundError exception handler that:
- Logs the full error message and request details
- Raises
ModelUnavailableErrorwith context - Will help diagnose the actual OpenRouter issue once deployed
Resolution
Fixed in commit 8675b1b and deployed as v40.
Related Issues
This is the third occurrence of the interaction lifecycle bug:
- Bug: Interaction deferral error in cross-channel permission checks #6 - First discovery in cross-channel error handling
- Bug: v35 used wrong method for deferred interactions #7 - v35 used wrong method after deferral
- This issue - Same bug in permission check code path
Next Steps
Monitor logs after deployment to see the actual NotFoundError details and determine why OpenRouter is returning 404.