From 716d3954e7569065d9fa47185279b63303eaffd7 Mon Sep 17 00:00:00 2001 From: Momentry Studio Date: Sat, 24 Oct 2026 12:25:01 +0800 Subject: [PATCH] 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 --- src-tauri/src/proxy.rs | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/src-tauri/src/proxy.rs b/src-tauri/src/proxy.rs index 5fb3ee3..b622b4b 100644 --- a/src-tauri/src/proxy.rs +++ b/src-tauri/src/proxy.rs @@ -265,20 +265,8 @@ async fn fallback_handler(State(state): State, 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/") {