Skip to main content

handle_fleet_bulk_stop

Function handle_fleet_bulk_stop 

Source
pub(super) async fn handle_fleet_bulk_stop(
    __arg0: State<AppState>,
    caller: Option<Extension<Caller>>,
    __arg2: Json<Value>,
) -> impl IntoResponse
Expand description

POST /api/v1/fleet/bulk-stop — Stop agents: close each named agent’s tab (docs/specs/SPEC_STOP_AN_AGENT_ONE_WAY_AND_SHUTDOWN_TOAST_2026_10_23.md). Backs the Stop tool’s agents action. Infallible per target (never a single bool): { succeeded, failed }.

Every running agent waits for its user’s override (§6.5 of SPEC_AGENT_SELF_QUIT_2026_09_24.md): 202 with a request per target, or 200 when nothing had to wait (everything refused or already gone). The request must carry the asking agent’s token, which names that agent on the banner and in the audit log; the optional signed auth only identifies the caller’s own block, so that it is refused.