Skip to content

POST /api/ai swallows upstream failure as HTTP 200 with empty reply #15

Description

@royalpinto007

Problem

A Groq {error: {message: "invalid api key"}} payload returns status 200 with {"reply": "", "error": ...}: failures look like empty successes.

Where

app/api/ai/route.ts (no r.ok/error check before responding).

Acceptance

Add a failing route test first asserting non-2xx when the upstream payload has error and no choices. Then map it to 502/400.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions