🩺 feat: Add Explicit Readiness Endpoints#13212
Conversation
There was a problem hiding this comment.
Pull request overview
Adds explicit Kubernetes-style health probe endpoints to the Node/Express server entrypoint so liveness can stay cheap while readiness reflects completion of post-listen initialization work.
Changes:
- Introduced
/livez(always200 OKonce the server is listening) and/readyz(returns503 NOT_READYuntil post-listen initialization completes). - Added a
serverReadygate that flips totrueafter MCP init, OAuth reconnect init, migrations, stream service setup, and optional memory diagnostics startup. - Added an informational log when readiness begins passing.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| app.get('/livez', (_req, res) => res.status(200).send('OK')); | ||
| app.get('/readyz', (_req, res) => { | ||
| if (!serverReady) { | ||
| return res.status(503).send('NOT_READY'); | ||
| } | ||
| return res.status(200).send('OK'); | ||
| }); |
|
@codex review |
GitNexus: 🚀 deployedThe |
|
Codex Review: Didn't find any major issues. Already looking forward to the next diff. ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Range: 8310e9a..190cdee Highlights: - Security: MCP OAuth hardening (danny-avila#13264, danny-avila#13274, danny-avila#13276, danny-avila#13254, danny-avila#13256), SSRF guards, system tenant rejection (danny-avila#13278), data retention semantics (danny-avila#13049) - LLM: Gemini 3.5 Flash (danny-avila#13231), Gemini Tool Combinations (danny-avila#13273), AWS Bedrock API key support (danny-avila#8690) [pending removal in stage-1] - Streaming/UI: cache preservation, race fixes, optimistic sidebar (danny-avila#13298) - Observability: Prometheus metrics (danny-avila#13265), OTel SSE tracing (danny-avila#13266), build metadata (danny-avila#12756) - Infra: graceful shutdown (danny-avila#13211), readiness endpoints (danny-avila#13212), Redis cluster safe delete (danny-avila#13275) - CI/format: prettier --write all workspaces (danny-avila#13281), ESLint enforcement (danny-avila#13280) - Deps: @librechat/agents -> v3.1.96
Summary
I added explicit Kubernetes health endpoints so liveness can stay cheap while readiness waits for post-listen initialization to finish. This complements #13211, which handles graceful shutdown, but does not duplicate that work.
/livezas a cheap liveness endpoint that always returns200 OKonce the HTTP server is serving requests./readyzas a readiness endpoint that returns503 NOT_READYuntil MCP initialization, OAuth reconnect initialization, migrations, stream service setup, and memory diagnostics startup have completed./healthunchanged for existing probes and backward compatibility.Change Type
Testing
node --check api/server/index.js.git diff --check.Test Configuration:
Checklist