Watch
0
0
Fork
You've already forked hyperhive
0

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.
This commit is contained in:
atlas 2026-10-04 22:04:03 +02:00 • committed by mara
commit 27b03e622e
2 changed files with 8 additions and 14 deletions

View file

@ -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"),
)
})?;

View file

@ -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"),
)
})?;