Skip to main content

get_agent

Function get_agent 

Source
pub async fn get_agent(
    __arg0: State<AppState>,
    __arg1: Path<String>,
) -> Result<Json<Agent>, ApiError>
Expand description

GET /api/agents/{id} — one agent’s current state.

This reads the live fleet snapshot — the exact same source as GET /api/fleet — so the two are always consistent: an agent that has been rm’d, or whose id was replaced by respawn, disappears from both the fleet listing and this endpoint (404) as soon as the registry no longer tracks it (immediately for rm via the optimistic snapshot prune, or at the next poll for a respawn’s old id). It is deliberately not served from the event-sourced projection: the immutable per-agent history of a replaced or removed agent remains reachable via GET /api/agents/{id}/events, which replays from the durable store and therefore intentionally outlives the agent’s presence in the live registry (#124).