diff --git a/src/app/api/health/route.ts b/src/app/api/health/route.ts index ea2172f..a494e5c 100644 --- a/src/app/api/health/route.ts +++ b/src/app/api/health/route.ts @@ -1,29 +1,19 @@ -// GET /api/health — liveness by default; add ?strict=1 for readiness. -// -// A dead LLM key must never fail the check a kill-and-restart decision reads: -// restarting the process can't fix someone else's outage. So the plain check -// always returns 200 once the process is up, carrying `llm` as information -// only. `?strict=1` is the opt-in for a caller that actually wants to know -// whether analysis currently works — it 503s only when the chain has been -// down for `downAfter` consecutive requests. +// GET /api/health — liveness. A dead LLM key must never fail the check a +// kill-and-restart decision reads: restarting the process can't fix someone +// else's outage. Always 200 once the process is up; `llm` is informational. -import { NextRequest, NextResponse } from "next/server"; +import { NextResponse } from "next/server"; import { getLLMHealth } from "@/lib/health"; -export async function GET(req: NextRequest) { +export async function GET() { const llm = getLLMHealth(); - const strict = req.nextUrl.searchParams.get("strict") === "1"; - const status = strict && llm.status === "down" ? 503 : 200; - return NextResponse.json( - { - success: true, - data: { - status: status === 200 ? "healthy" : "unhealthy", - llm, - timestamp: new Date().toISOString(), - }, + return NextResponse.json({ + success: true, + data: { + status: "healthy", + llm, + timestamp: new Date().toISOString(), }, - { status }, - ); + }); }