Fix control status: do not treat /health as fleet (missing positions).
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -74,13 +74,23 @@ async def probe_health(
|
||||
node, "GET", "/health", require_token=False, timeout=timeout
|
||||
)
|
||||
if code == 200 and isinstance(data, dict):
|
||||
return {"online": True, "health": data, "error": None}
|
||||
return {
|
||||
"online": True,
|
||||
"health": data,
|
||||
"error": None,
|
||||
"from_fleet": False,
|
||||
}
|
||||
# fallback fleet status if health blocked
|
||||
code2, data2 = await call_node(
|
||||
node, "GET", "/api/fleet/status", require_token=True, timeout=timeout
|
||||
)
|
||||
if code2 == 200 and isinstance(data2, dict):
|
||||
return {"online": True, "health": data2, "error": None}
|
||||
return {
|
||||
"online": True,
|
||||
"health": data2,
|
||||
"error": None,
|
||||
"from_fleet": True,
|
||||
}
|
||||
detail = ""
|
||||
if isinstance(data, dict):
|
||||
detail = str(data.get("detail") or "")
|
||||
@@ -88,4 +98,5 @@ async def probe_health(
|
||||
"online": False,
|
||||
"health": None,
|
||||
"error": detail or f"HTTP {code}",
|
||||
"from_fleet": False,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user