Files
mission-control-v2/backend/routers/health.py
T
Hitonabi 21ea7e1dd3 backend: Pydantic response_models für 5 GET-Endpoints hinzufügen
- health.py: HealthResponse
- eigenleben.py: EigenlebenOverviewResponse + SkillTextResponse
- chronik.py: ChronikResponse + ChronikItem
- wissen.py: WissenListResponse + WissenFileResponse
- reminders.py: ReminderListResponse + ReminderOut

py_compile bestanden, /docs zeigt neue Schemata.
Response-Payloads unverändert — nur Typisierung hinzugefügt.
2026-07-15 19:33:39 +02:00

32 lines
888 B
Python

"""Health-/Status-Endpoint — schlanker Lebenszeichen-Check für MC 2.0."""
from pydantic import BaseModel
from fastapi import APIRouter
from config import VERSION
from services import gateway, llamaswap
router = APIRouter(prefix="/api")
class HealthResponse(BaseModel):
status: str
version: str
engine_reachable: bool
gateway_reachable: bool
brain: dict
@router.get("/health", response_model=HealthResponse)
def health() -> dict:
return {
"status": "ok",
"version": VERSION,
"engine_reachable": llamaswap.engine_reachable(),
"gateway_reachable": gateway.gateway_reachable(),
# Echte Hirn-Bereitschaft: Engine kann erreichbar sein, das Agent-Hirn ('fast') aber tot
# (Crash/OOM nach Engine-Update). Das wäre sonst ein silent fail (App-Fehler statt Status).
"brain": llamaswap.brain_status(),
}