fix: Enhance admin API health check reliability and error handling#841
Merged
Conversation
…ontainer needs time to restart
Ragini-Microsoft
requested review from
Avijit-Microsoft,
Prajwal-Microsoft,
Roopan-Microsoft,
Vinay-Microsoft,
aniaroramsft,
malrose07,
nchandhi and
toherman-msft
as code owners
May 7, 2026 04:42
Ragini-Microsoft
temporarily deployed
to
production
May 7, 2026 04:42 — with
GitHub Actions
Inactive
Ragini-Microsoft
marked this pull request as draft
May 7, 2026 04:43
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Improves admin API health checks and /api proxy behavior to avoid false “healthy” signals and to return clearer errors when the backend is unreachable or not configured.
Changes:
- Refactors
/apiproxy setup and returns a JSON 503 whenBACKEND_URLis missing. - Strengthens admin API health check validation by verifying expected JSON payload vs. frontend HTML fallback.
- Increases health check retry count and delay to better tolerate cold starts/container restarts.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| src/App/server/server.js | Improves /api proxy wiring and adds explicit 503 JSON response when backend is not configured. |
| scripts/post_deploy.py | Enhances health check robustness by validating response contents and increasing retry/backoff timing. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Ragini-Microsoft
temporarily deployed
to
production
May 7, 2026 05:39 — with
GitHub Actions
Inactive
Ragini-Microsoft
temporarily deployed
to
production
May 7, 2026 05:42 — with
GitHub Actions
Inactive
Ragini-Microsoft
temporarily deployed
to
production
May 7, 2026 05:42 — with
GitHub Actions
Inactive
Ragini-Microsoft
temporarily deployed
to
production
May 7, 2026 05:55 — with
GitHub Actions
Inactive
Ragini-Microsoft
temporarily deployed
to
production
May 7, 2026 05:59 — with
GitHub Actions
Inactive
Ragini-Microsoft
temporarily deployed
to
production
May 7, 2026 06:24 — with
GitHub Actions
Inactive
Ragini-Microsoft
temporarily deployed
to
production
May 7, 2026 06:31 — with
GitHub Actions
Inactive
Ragini-Microsoft
temporarily deployed
to
production
May 7, 2026 06:33 — with
GitHub Actions
Inactive
Ragini-Microsoft
temporarily deployed
to
production
May 7, 2026 06:33 — with
GitHub Actions
Inactive
Ragini-Microsoft
temporarily deployed
to
production
May 7, 2026 06:45 — with
GitHub Actions
Inactive
Ragini-Microsoft
temporarily deployed
to
production
May 7, 2026 06:49 — with
GitHub Actions
Inactive
Ragini-Microsoft
marked this pull request as ready for review
May 7, 2026 07:31
Ragini-Microsoft
temporarily deployed
to
production
May 7, 2026 07:31 — with
GitHub Actions
Inactive
Avijit-Microsoft
approved these changes
May 7, 2026
Contributor
|
🎉 This PR is included in version 2.5.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
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.
Purpose
This pull request improves the reliability and clarity of backend API health checks and the API proxying logic. It enhances the health check to better distinguish between valid backend responses and frontend fallback, and improves the server's error handling when the backend is misconfigured or unavailable.
Backend health check improvements:
check_admin_api_healthfunction now retries more times (8 instead of 5) with a longer delay (20s instead of 10s), and its docstring clarifies it also handles container restarts.{"status": "healthy"}), and logs warnings if the response is unexpected or if HTML is returned (which often means the frontend is serving a fallback instead of the backend). This helps catch misconfigurations where the backend is not properly connected.API proxy and error handling improvements:
server.js, the API proxy middleware setup is refactored for clarity, and a new handler is added: ifBACKEND_URLis not set, API requests to/apinow get a clear 503 error response instead of falling through to the frontend SPA, which would incorrectly return a 200 withindex.html. [1] [2]Does this introduce a breaking change?
Golden Path Validation
Deployment Validation