feat: track whether the LLM chain is actually up - #36
Merged
Conversation
callLLM already knew when every vendor in the chain refused; nothing remembered that fact between requests. Adds ai-kit's createHealthTracker (same tracker adopted fleet-wide: botsmann, hirnli, evig, kivvi, aoz-housing) at callLLM's success return and its three throw points, and a new /api/health route — this app had none — exposing it. Liveness stays 200 regardless; ?strict=1 opts into 503 only once the chain has been down for 3 consecutive requests, since a dead key can't be fixed by a restart and must never fail the check that triggers one. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HVwg8DKHQktxJuHeLM3xpG
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ai-kit'screateHealthTracker(same tracker adopted fleet-wide: botsmann, hirnli, evig, kivvi, aoz-housing) atcallLLM's single success return and its three throw points — no control-flow changes./api/health— this app had no health endpoint at all. PlainGETis liveness, always 200 once the process is up;?strict=1opts into 503 once the chain has been down for 3 consecutive requests. A dead key can't be fixed by a restart, so the default check must never fail on one.Test plan
npm run verify(format:check + lint + typecheck + test) — all green, 52/52 tests passing