Skip to content

fix(health): stop gating HTTP status on AI vendor health - #38

Merged
catomean merged 1 commit into
mainfrom
fix/health-strict-ai-gate
Sep 2, 2026
Merged

fix(health): stop gating HTTP status on AI vendor health#38
catomean merged 1 commit into
mainfrom
fix/health-strict-ai-gate

Conversation

@catomean

@catomean catomean commented Sep 2, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • /api/health?strict=1 returned 503 when the LLM health tracker reported "down" — but a dead vendor key or exhausted budget can't be fixed by restarting the process, so a monitoring system that restarts on a failing health check would loop pointlessly.
  • The endpoint now always returns 200 once the process is up (assuming liveness); llm health stays in the response body as an informational field only.
  • strict had no other legitimate purpose in this route, so its query-param handling is removed entirely rather than left as dead branching.

Test plan

  • npm run verify (format, lint, typecheck, test) — all green
  • Confirmed no existing test asserted the old 503-on-strict behavior (only src/lib/health.test.ts exists, covering the tracker state machine, unaffected)

🤖 Generated with Claude Code

The `?strict=1` mode 503'd when the LLM chain was down, even though a
dead vendor key can't be fixed by restarting the process. A monitoring
system that restarts on a failing health check would loop pointlessly
on a problem restarting can't solve. Health status is now always 200
once the process is up; `llm` stays in the response body as an
informational field. `strict` had no other purpose, so its handling is
removed entirely rather than left as dead branching.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HVwg8DKHQktxJuHeLM3xpG
@catomean
catomean merged commit b25eacb into main Sep 2, 2026
1 check passed
@catomean
catomean deleted the fix/health-strict-ai-gate branch September 2, 2026 11:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant