Skip to content

Dodaios is an open-source agent OS for your desktop: it runs your coding agents, browser and apps by voice or chat, on your own machine. Formerly Personal Jarvis.

696 B
Raw Blame
"""``GET /healthz`` — public, no auth.

Returns only liveness/schema status. Polled by Docker healthchecks.
"""
from __future__ import annotations

from fastapi import APIRouter, Request
from sqlalchemy import text

from .. import __version__
from ..schemas import HealthResponse

router = APIRouter(tags=["public"])


@router.get("/healthz", response_model=HealthResponse)
def healthz(request: Request) -> HealthResponse:
    schema_ok = True
    try:
        with request.app.state.engine.connect() as conn:
            conn.execute(text("SELECT 1"))
    except Exception:  # noqa: BLE001
        schema_ok = False
    return HealthResponse(ok=True, version=__version__, schema_ok=schema_ok)