Skip to content

Bug: Permission check and OpenRouter 404 errors #11

@mrjcleaver

Description

@mrjcleaver

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 ModelUnavailableError with 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:

Next Steps

Monitor logs after deployment to see the actual NotFoundError details and determine why OpenRouter is returning 404.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions