From 27b03e622e405085888ae6fd9e95bf6f75ba084e Mon Sep 17 00:00:00 2001 From: atlas Date: Sun, 4 Oct 2026 22:04:03 +0200 Subject: [PATCH] swarm-controller: the term and state stream 404/500 text describes a per-agent stream The handlers read the agent's status only to learn whether it has ever reported; no hive is used to build the stream. The 404 and 500 messages and their OpenAPI descriptions now say that. --- swarm-controller/src/agent_state_stream.rs | 11 ++++------- swarm-controller/src/term_stream.rs | 11 ++++------- 2 files changed, 8 insertions(+), 14 deletions(-) diff --git a/swarm-controller/src/agent_state_stream.rs b/swarm-controller/src/agent_state_stream.rs index 8594d724..4fb75aba 100644 --- a/swarm-controller/src/agent_state_stream.rs +++ b/swarm-controller/src/agent_state_stream.rs @@ -51,12 +51,12 @@ const SUBJECT_PREFIX: &str = "$SWARM.agent-state"; body = String, content_type = "text/event-stream"), (status = 400, description = "the agent name is not shaped like an identifier \ (problem+json)", body = String), - (status = 404, description = "the agent has never reported to the swarm, so no \ - hive is on record to stream its state from (problem+json)", body = String), + (status = 404, description = "the agent has never reported to the swarm \ + (problem+json)", body = String), (status = 503, description = "no swarm queue is configured on this host, no \ agent-status reader is wired up, or the queue could not be reached \ (problem+json)", body = String), - (status = 500, description = "reading the agent's last-known hive failed, or the \ + (status = 500, description = "reading the agent's status failed, or the \ subscribe itself failed (problem+json)", body = String), ), tag = "agents" @@ -97,10 +97,7 @@ pub(crate) async fn stream_agent_state( .ok_or_else(|| { crate::error_problem( axum::http::StatusCode::NOT_FOUND, - &format!( - "{agent:?} has never reported to the swarm; no hive is on record to \ - stream its state from" - ), + &format!("{agent:?} has never reported to the swarm"), ) })?; diff --git a/swarm-controller/src/term_stream.rs b/swarm-controller/src/term_stream.rs index 9c72de1d..71ab39ee 100644 --- a/swarm-controller/src/term_stream.rs +++ b/swarm-controller/src/term_stream.rs @@ -49,12 +49,12 @@ const SUBJECT_PREFIX: &str = "$SWARM.term"; body = String, content_type = "text/event-stream"), (status = 400, description = "the agent name is not shaped like an identifier \ (problem+json)", body = String), - (status = 404, description = "the agent has never reported to the swarm, so no \ - hive is on record to stream its terminal from (problem+json)", body = String), + (status = 404, description = "the agent has never reported to the swarm \ + (problem+json)", body = String), (status = 503, description = "no swarm queue is configured on this host, no \ agent-status reader is wired up, or the queue could not be reached \ (problem+json)", body = String), - (status = 500, description = "reading the agent's last-known hive failed, or the \ + (status = 500, description = "reading the agent's status failed, or the \ subscribe itself failed (problem+json)", body = String), ), tag = "agents" @@ -95,10 +95,7 @@ pub(crate) async fn stream_agent_term( .ok_or_else(|| { crate::error_problem( axum::http::StatusCode::NOT_FOUND, - &format!( - "{agent:?} has never reported to the swarm; no hive is on record to \ - stream its terminal from" - ), + &format!("{agent:?} has never reported to the swarm"), ) })?;