Skip to content

🩺 feat: Add Explicit Readiness Endpoints#13212

Merged
danny-avila merged 1 commit into
devfrom
danny-avila/add-livez-readyz
May 20, 2026
Merged

🩺 feat: Add Explicit Readiness Endpoints#13212
danny-avila merged 1 commit into
devfrom
danny-avila/add-livez-readyz

Conversation

@danny-avila

Copy link
Copy Markdown
Owner

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.

  • Added /livez as a cheap liveness endpoint that always returns 200 OK once the HTTP server is serving requests.
  • Added /readyz as a readiness endpoint that returns 503 NOT_READY until MCP initialization, OAuth reconnect initialization, migrations, stream service setup, and memory diagnostics startup have completed.
  • Kept /health unchanged for existing probes and backward compatibility.
  • Logged when server readiness checks begin passing.

Change Type

  • New feature (non-breaking change which adds functionality)

Testing

  • Ran node --check api/server/index.js.
  • Ran git diff --check.

Test Configuration:

  • Node syntax verification only; this worktree does not have dependencies installed, so I did not run the Jest suite locally.

Checklist

  • My code adheres to this project's style guidelines
  • I have performed a self-review of my own code
  • My changes do not introduce new warnings

Copilot AI review requested due to automatic review settings May 20, 2026 14:48

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 (always 200 OK once the server is listening) and /readyz (returns 503 NOT_READY until post-listen initialization completes).
  • Added a serverReady gate that flips to true after 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.

Comment thread api/server/index.js
Comment on lines +117 to +123
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');
});
@danny-avila

Copy link
Copy Markdown
Owner Author

@codex review

@github-actions

Copy link
Copy Markdown
Contributor

GitNexus: 🚀 deployed

The LibreChat-pr-13212 index is now live on the MCP server.
Deploy run

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Already looking forward to the next diff.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

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".

@danny-avila
danny-avila merged commit 9cb650d into dev May 20, 2026
16 checks passed
@danny-avila
danny-avila deleted the danny-avila/add-livez-readyz branch May 20, 2026 17:34
fuuuzzy pushed a commit to fuuuzzy/LibreChat that referenced this pull request May 22, 2026
Gevtolev pushed a commit to Gevtolev/LibreChat that referenced this pull request May 27, 2026
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
ThomasVuNguyen pushed a commit to ThomasVuNguyen/LibreChat that referenced this pull request Jul 15, 2026
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.

2 participants