Private
Public Access
1
0

fix: ServiceStatusData deserialization mismatch with agent response
Some checks failed
CI Pipeline / Rust Format Check (push) Failing after 4s
CI Pipeline / Clippy Lints (push) Successful in 45s
CI Pipeline / Rust Unit Tests (push) Successful in 1m2s
CI Pipeline / Security Audit (push) Successful in 5s
CI Pipeline / Frontend Lint & Type Check (push) Failing after 9s
CI Pipeline / Build .deb & Release (push) Has been skipped

Manager expected fields: name, status, healthy, uptime_secs
Agent actually returns: name, display_name, active_state, sub_state,
load_state, enabled_state, main_pid, healthy

Updated ServiceStatusData to match agent response format.
Updated health_check_poller.rs to use new field names.
This commit is contained in:
2026-05-05 15:13:41 +00:00
parent 6eeedb1793
commit c51b48f7b0
2 changed files with 20 additions and 9 deletions

View File

@ -202,12 +202,20 @@ pub struct AgentJobStatus {
pub struct ServiceStatusData { pub struct ServiceStatusData {
/// Service name. /// Service name.
pub name: String, pub name: String,
/// Service status string (e.g. `"running"`, `"stopped"`, `"failed"`). /// Human-readable service name.
pub status: String, pub display_name: String,
/// Active state (e.g. `"active"`, `"inactive"`, `"failed"`).
pub active_state: String,
/// Sub state (e.g. `"running"`, `"dead"`, `"exited"`).
pub sub_state: String,
/// Load state (e.g. `"loaded"`, `"not-found"`).
pub load_state: String,
/// Enabled state (e.g. `"enabled"`, `"disabled"`).
pub enabled_state: String,
/// Main PID of the service process.
pub main_pid: Option<u32>,
/// Whether the service is considered healthy. /// Whether the service is considered healthy.
pub healthy: bool, pub healthy: bool,
/// Seconds elapsed since the service started (`null` if not running).
pub uptime_secs: Option<u64>,
} }
// ============================================================ // ============================================================

View File

@ -262,15 +262,18 @@ async fn run_service_check(
Ok(data) => { Ok(data) => {
let detail = if data.healthy { let detail = if data.healthy {
format!( format!(
"Service '{}' is {} (uptime: {}s)", "Service '{}' is {}/{} (enabled: {})",
data.name, data.name,
data.status, data.active_state,
data.uptime_secs.map_or("N/A".to_string(), |s| s.to_string()) data.sub_state,
data.enabled_state
) )
} else { } else {
format!( format!(
"Service '{}' status: {} (unhealthy)", "Service '{}' status: {}/{} (unhealthy, enabled: {})",
data.name, data.status data.name, data.active_state,
data.sub_state,
data.enabled_state
) )
}; };
(data.healthy, detail) (data.healthy, detail)