From 9a47a837e56b86a38b90a251d4a40b7c26f261d0 Mon Sep 17 00:00:00 2001 From: damocles Date: Mon, 7 Sep 2026 13:15:59 +0200 Subject: [PATCH] AgentStatusRow: status_set_at as RFC 3339 UTC, not a raw unix int --- hive-c0re/src/container_view.rs | 11 +++++++---- hive-sh4re/src/container.rs | 8 +++++--- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/hive-c0re/src/container_view.rs b/hive-c0re/src/container_view.rs index 592382e1..f0639e9e 100644 --- a/hive-c0re/src/container_view.rs +++ b/hive-c0re/src/container_view.rs @@ -8,6 +8,7 @@ use std::collections::HashMap; use std::path::Path; +use chrono::{DateTime, Utc}; use serde::Serialize; use crate::coordinator::Coordinator; @@ -69,10 +70,11 @@ pub struct ContainerView { /// status is treated as stale rather than surfaced. #[serde(default, skip_serializing_if = "Option::is_none")] pub status_text: Option, - /// Unix timestamp (seconds) `status_text` was last set. `None` - /// exactly when `status_text` is `None`. + /// When `status_text` was last set, RFC 3339 UTC on the wire (see + /// `hive_sh4re::wire_time`). `None` exactly when `status_text` is + /// `None`. #[serde(default, skip_serializing_if = "Option::is_none")] - pub status_set_at: Option, + pub status_set_at: Option>, /// The agent's turn loop is parked: the container is up and still /// serving its web UI / MCP daemons, but it drives no turns and its /// inbox messages queue unacked until it resumes. Sourced from the @@ -171,7 +173,8 @@ pub async fn build_all(hive: &crate::coordinator::HiveEnv) -> Vec // would re-derive `running` with its own `lifecycle::is_running` // shell-out when this loop already has it for free. let (status_text, status_set_at) = if running { - read_agent_status(&logical) + let (text, set_at) = read_agent_status(&logical); + (text, set_at.map(hive_sh4re::wire_time::from_secs)) } else { (None, None) }; diff --git a/hive-sh4re/src/container.rs b/hive-sh4re/src/container.rs index 24fcbeaa..27ace066 100644 --- a/hive-sh4re/src/container.rs +++ b/hive-sh4re/src/container.rs @@ -2,6 +2,7 @@ //! `HostRequest::AgentStatus` return, plus the per-account matrix //! identity shape surfaced by `GetAgentMeta`. +use chrono::{DateTime, Utc}; use serde::{Deserialize, Serialize}; /// One entry in a `ListDescendants` result. @@ -77,10 +78,11 @@ pub struct AgentStatusRow { /// applies for every other reader of this data). #[serde(default, skip_serializing_if = "Option::is_none")] pub status_text: Option, - /// Unix timestamp (seconds) `status_text` was last set. `None` - /// exactly when `status_text` is `None`. + /// When `status_text` was last set, RFC 3339 UTC on the wire (see + /// `hive_sh4re::wire_time`). `None` exactly when `status_text` is + /// `None`. #[serde(default, skip_serializing_if = "Option::is_none")] - pub status_set_at: Option, + pub status_set_at: Option>, } /// One matrix identity an agent can act as, surfaced in `GetAgentMeta`'s