Skip to content

Standardize health check response format#2883

Draft
neubig wants to merge 3 commits intomainfrom
openhands/standardize-health-response
Draft

Standardize health check response format#2883
neubig wants to merge 3 commits intomainfrom
openhands/standardize-health-response

Conversation

@neubig
Copy link
Copy Markdown
Contributor

@neubig neubig commented Apr 19, 2026

  • A human has tested these changes.

Why

The health check endpoints were returning inconsistent payload types: /alive already returned JSON, while /health returned a plain string. This makes simple health probes work, but it is less consistent for API consumers and tooling.

Summary

  • return {"status": "ok"} from /health so it matches /alive
  • add a router test covering the shared /alive and /health JSON payload
  • add a live-server regression test for the same response shape

Issue Number

Closes #1826.

How to Test

  • Run uv run pytest tests/agent_server/test_server_details_router.py
  • Optionally run uv run pytest tests/cross/test_remote_conversation_live_server.py::test_health_endpoints_return_ok_json
  • Manual app check:
    • uv run python - <<'PY'
    • from fastapi.testclient import TestClient
    • from openhands.agent_server.api import create_app
    • from openhands.agent_server.config import Config
    • client = TestClient(create_app(Config(static_files_path=None)))
    • print(client.get('/alive').status_code, client.get('/alive').json())
    • print(client.get('/health').status_code, client.get('/health').json())
    • PY
  • Observed locally:
    • /alive 200 {'status': 'ok'}
    • /health 200 {'status': 'ok'}

Video/Screenshots

Not applicable for this API-only change.

Type

  • Bug fix
  • Feature
  • Refactor
  • Breaking change
  • Docs / chore

Notes

  • This PR description was created by an AI assistant (OpenHands) on behalf of the user.

@neubig can click here to continue refining the PR


Agent Server images for this PR

GHCR package: https://github.com/OpenHands/agent-sdk/pkgs/container/agent-server

Variants & Base Images

Variant Architectures Base Image Docs / Tags
java amd64, arm64 eclipse-temurin:17-jdk Link
python amd64, arm64 nikolaik/python-nodejs:python3.13-nodejs22-slim Link
golang amd64, arm64 golang:1.21-bookworm Link

Pull (multi-arch manifest)

# Each variant is a multi-arch manifest supporting both amd64 and arm64
docker pull ghcr.io/openhands/agent-server:9bbba02-python

Run

docker run -it --rm \
  -p 8000:8000 \
  --name agent-server-9bbba02-python \
  ghcr.io/openhands/agent-server:9bbba02-python

All tags pushed for this build

ghcr.io/openhands/agent-server:9bbba02-golang-amd64
ghcr.io/openhands/agent-server:9bbba02-golang_tag_1.21-bookworm-amd64
ghcr.io/openhands/agent-server:9bbba02-golang-arm64
ghcr.io/openhands/agent-server:9bbba02-golang_tag_1.21-bookworm-arm64
ghcr.io/openhands/agent-server:9bbba02-java-amd64
ghcr.io/openhands/agent-server:9bbba02-eclipse-temurin_tag_17-jdk-amd64
ghcr.io/openhands/agent-server:9bbba02-java-arm64
ghcr.io/openhands/agent-server:9bbba02-eclipse-temurin_tag_17-jdk-arm64
ghcr.io/openhands/agent-server:9bbba02-python-amd64
ghcr.io/openhands/agent-server:9bbba02-nikolaik_s_python-nodejs_tag_python3.13-nodejs22-slim-amd64
ghcr.io/openhands/agent-server:9bbba02-python-arm64
ghcr.io/openhands/agent-server:9bbba02-nikolaik_s_python-nodejs_tag_python3.13-nodejs22-slim-arm64
ghcr.io/openhands/agent-server:9bbba02-golang
ghcr.io/openhands/agent-server:9bbba02-java
ghcr.io/openhands/agent-server:9bbba02-python

About Multi-Architecture Support

  • Each variant tag (e.g., 9bbba02-python) is a multi-arch manifest supporting both amd64 and arm64
  • Docker automatically pulls the correct architecture for your platform
  • Individual architecture tags (e.g., 9bbba02-python-amd64) are also available if needed

Co-authored-by: openhands <openhands@all-hands.dev>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 19, 2026

Python API breakage checks — ✅ PASSED

Result:PASSED

Action log

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 19, 2026

REST API breakage checks (OpenAPI) — ✅ PASSED

Result:PASSED

Action log

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 19, 2026

Coverage

Coverage Report •
FileStmtsMissCoverMissing
openhands-agent-server/openhands/agent_server
   server_details_router.py51296%20–21
TOTAL234251060254% 

Co-authored-by: openhands <openhands@all-hands.dev>
Co-authored-by: openhands <openhands@all-hands.dev>
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.

Standardize response format across health check endpoints

2 participants