agent: /send returns 200 (terminal + turn-end refresh already cover the visual update)

This commit is contained in:
müde 2026-05-17 12:41:37 +02:00
parent 616ca38199
commit aa24080f7b

View file

@ -343,7 +343,13 @@ async fn post_send(State(state): State<AppState>, Form(form): Form<SendForm>) ->
},
};
match result {
Ok(()) => Redirect::to("/").into_response(),
// 200 instead of 303 → the client doesn't refetch /api/state.
// The operator message becomes a broker `Sent` (already shown
// server-side in the dashboard); on the agent side, the
// resulting `TurnStart` SSE event drives the terminal + the
// inbox row gets consumed by the time `TurnEnd` fires the
// existing turn-end refresh.
Ok(()) => (axum::http::StatusCode::OK, "ok").into_response(),
Err(e) => error_response(&format!("send failed: {e}")),
}
}