AgentStatusRow: carry active_model + set_status text/timestamp
This commit is contained in:
parent
73c5c06e31
commit
5640832116
5 changed files with 46 additions and 0 deletions
|
|
@ -63,6 +63,16 @@ pub struct ContainerView {
|
|||
/// for stopped containers.
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
pub active_model: Option<String>,
|
||||
/// The agent's current free-text status (`set_status`). `None` when
|
||||
/// unset, or when the container isn't running — see
|
||||
/// [`read_agent_status_live`] for why a stopped agent's on-disk
|
||||
/// status is treated as stale rather than surfaced.
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
pub status_text: Option<String>,
|
||||
/// Unix timestamp (seconds) `status_text` was last set. `None`
|
||||
/// exactly when `status_text` is `None`.
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
pub status_set_at: Option<i64>,
|
||||
/// 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
|
||||
|
|
@ -155,6 +165,16 @@ pub async fn build_all(hive: &crate::coordinator::HiveEnv) -> Vec<ContainerView>
|
|||
} else {
|
||||
None
|
||||
};
|
||||
// Same running-gate as `active_model` just above, and the same
|
||||
// rule `read_agent_status_live` applies for its other callers —
|
||||
// duplicated inline rather than calling that helper because it
|
||||
// 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)
|
||||
} else {
|
||||
(None, None)
|
||||
};
|
||||
let paused = Coordinator::is_paused(&logical);
|
||||
let (cpu_quota, memory_max) = crate::resource_limits::effective_from(
|
||||
&limits,
|
||||
|
|
@ -173,6 +193,8 @@ pub async fn build_all(hive: &crate::coordinator::HiveEnv) -> Vec<ContainerView>
|
|||
deployed_sha,
|
||||
parent,
|
||||
active_model,
|
||||
status_text,
|
||||
status_set_at,
|
||||
paused,
|
||||
cpu_quota,
|
||||
memory_max,
|
||||
|
|
|
|||
Loading…
Reference in a new issue