GET /api/v1/health answered {"status":"ok"} unconditionally. The Docker HEALTHCHECK (Dockerfile.agent), the nightly's wait loop and scripts/smoke.sh all read it, so an agent that had lost MongoDB still counted as healthy.
What
New DatabasePool::ping(): a ping command on the admin database.
The health handler pings with a 2 s timeout and answers:
200 {"status":"ok"} when MongoDB answers;
503 {"status":"degraded","mongo":"unreachable"} when it does not, with a warning in the log.
The route stays public and untraced (PUBLIC_ENDPOINTS, UNTRACED).
Tests
A unit test for the status mapping.
The existing integration test health_endpoint_returns_ok runs against live Mongo in CI.
Closes #60.
`GET /api/v1/health` answered `{"status":"ok"}` unconditionally. The Docker `HEALTHCHECK` (`Dockerfile.agent`), the nightly's wait loop and `scripts/smoke.sh` all read it, so an agent that had lost MongoDB still counted as healthy.
## What
- New `DatabasePool::ping()`: a `ping` command on the `admin` database.
- The health handler pings with a 2 s timeout and answers:
- 200 `{"status":"ok"}` when MongoDB answers;
- 503 `{"status":"degraded","mongo":"unreachable"}` when it does not, with a warning in the log.
- The route stays public and untraced (`PUBLIC_ENDPOINTS`, `UNTRACED`).
## Tests
- A unit test for the status mapping.
- The existing integration test `health_endpoint_returns_ok` runs against live Mongo in CI.
- Built and tested in CI only.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
GET /api/v1/health answered ok unconditionally, so the container health
check and a load balancer kept an instance that could not reach its
database. It now pings MongoDB (2 s timeout): 200 {"status":"ok"} when
it answers, 503 {"status":"degraded","mongo":"unreachable"} when not.
Closes#60.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
sharang
merged commit 2523ecb018 into main2026-11-04 08:17:16 +00:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Closes #60.
GET /api/v1/healthanswered{"status":"ok"}unconditionally. The DockerHEALTHCHECK(Dockerfile.agent), the nightly's wait loop andscripts/smoke.shall read it, so an agent that had lost MongoDB still counted as healthy.What
DatabasePool::ping(): apingcommand on theadmindatabase.{"status":"ok"}when MongoDB answers;{"status":"degraded","mongo":"unreachable"}when it does not, with a warning in the log.PUBLIC_ENDPOINTS,UNTRACED).Tests
health_endpoint_returns_okruns against live Mongo in CI.🤖 Generated with Claude Code
GET /api/v1/health answered ok unconditionally, so the container health check and a load balancer kept an instance that could not reach its database. It now pings MongoDB (2 s timeout): 200 {"status":"ok"} when it answers, 503 {"status":"degraded","mongo":"unreachable"} when not. Closes #60. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>