fix: proxy forwards mbe health to Core API instead of direct llama-server access

- Previously proxy accessed llama-server /health endpoint directly
- Now forwards /api/v1/mbe/health to Core API (3002) which has full health check
- Returns complete health info: status, model, uptime
- Fixes frontend not showing 'online' status in Admin Settings
This commit is contained in:
2026-10-24 12:25:01 +08:00
parent b1978fabc5
commit 716d3954e7

View File

@@ -265,20 +265,8 @@ async fn fallback_handler(State(state): State<ProxyState>, req: axum::extract::R
// Handle MBE health check proxy
if path == "/api/v1/mbe/health" {
let client = reqwest::Client::new();
match client.get("http://localhost:8080/health").send().await {
Ok(resp) => {
let status = resp.status().as_u16();
let body = resp.bytes().await.unwrap_or_default();
let status_code = axum::http::StatusCode::from_u16(status).unwrap_or(axum::http::StatusCode::INTERNAL_SERVER_ERROR);
let mut builder = axum::http::Response::builder().status(status_code);
builder = builder.header("content-type", "application/json");
return builder.body(axum::body::Body::from(body)).unwrap().into_response();
}
Err(_) => {
return (StatusCode::SERVICE_UNAVAILABLE, "{\"status\":\"unreachable\"}").into_response();
}
}
// Forward to Core API which has full health check logic
return proxy_to(state, req, CORE_API, false).await;
}
if path.starts_with("/api/v2/") {