From f17ee5659e5a2c13a8448663a790fed39c168e36 Mon Sep 17 00:00:00 2001 From: iris Date: Wed, 20 May 2026 13:11:02 +0200 Subject: [PATCH 1/4] add reminder rollup RPC and broker query Surface reminder activity statistics (scheduled, delivered, pending counts) for each agent over configurable time windows. Needed by the per-agent stats page to display reminder metrics. Adds: - ReminderStats struct and ReminderRollup request/response variants - Broker::reminder_rollup_for(agent, since_secs) method - Agent and manager socket handlers for the new RPC - SocketReply mapping for response conversion From 96d35786a5a4d69cf1375df6198450637952e5f1 Mon Sep 17 00:00:00 2001 From: iris Date: Wed, 20 May 2026 13:14:27 +0200 Subject: [PATCH 2/4] fix: handle ReminderRollup in agent/manager response patterns Add the ReminderRollup variant to exhaustive pattern matches in both hive-ag3nt and hive-m1nd binaries. From 86a499eeb547d7c762ede3a44188532355f7ff05 Mon Sep 17 00:00:00 2001 From: iris Date: Wed, 20 May 2026 13:22:48 +0200 Subject: [PATCH 3/4] add reminder_stats field to stats Snapshot Add Optional field to the per-agent stats page response, placeholder for future ReminderRollup RPC integration to fetch reminder activity metrics from the broker. From bded8d789f5dab0d55c013bd05112abb400c85cd Mon Sep 17 00:00:00 2001 From: iris Date: Wed, 20 May 2026 13:25:54 +0200 Subject: [PATCH 4/4] integrate reminder stats into stats page via socket RPC Add fetch_reminder_stats() helper to query ReminderRollup from broker, and update api_stats endpoint to include reminder stats in snapshot. Reminder activity metrics (scheduled, delivered, pending) are now available to the stats page UI for display. --- hive-ag3nt/src/web_ui.rs | 47 ++++++++++++++++++++++++++++++++++++++-- 1 file changed, 45 insertions(+), 2 deletions(-) diff --git a/hive-ag3nt/src/web_ui.rs b/hive-ag3nt/src/web_ui.rs index 45a4a60..4e35833 100644 --- a/hive-ag3nt/src/web_ui.rs +++ b/hive-ag3nt/src/web_ui.rs @@ -221,11 +221,20 @@ struct StatsQuery { } async fn api_stats( - State(_state): State, + State(state): State, axum::extract::Query(q): axum::extract::Query, ) -> axum::Json { let window = crate::stats::Window::parse(q.window.as_deref().unwrap_or("24h")); - axum::Json(crate::stats::snapshot_default(window)) + let mut snapshot = crate::stats::snapshot_default(window); + // Fetch reminder stats from the broker. The window spans are: + // 24h = 86400s, 7d = 604800s, 30d = 2592000s. + let window_secs = match window { + crate::stats::Window::Day => 24 * 3600, + crate::stats::Window::Week => 7 * 24 * 3600, + crate::stats::Window::Month => 30 * 24 * 3600, + }; + snapshot.reminder_stats = fetch_reminder_stats(&state.socket, state.flavor(), window_secs as u64).await; + axum::Json(snapshot) } #[derive(Serialize)] @@ -392,6 +401,40 @@ async fn recent_inbox(socket: &std::path::Path, flavor: Flavor) -> Vec Option { + match flavor { + Flavor::Agent => { + match client::request::<_, hive_sh4re::AgentResponse>( + socket, + &hive_sh4re::AgentRequest::ReminderRollup { + since_secs: window_secs, + }, + ) + .await + { + Ok(hive_sh4re::AgentResponse::ReminderRollup(stats)) => Some(stats), + _ => None, + } + } + Flavor::Manager => { + match client::request::<_, hive_sh4re::ManagerResponse>( + socket, + &hive_sh4re::ManagerRequest::ReminderRollup { + since_secs: window_secs, + }, + ) + .await + { + Ok(hive_sh4re::ManagerResponse::ReminderRollup(stats)) => Some(stats), + _ => None, + } + } + } +} + // --------------------------------------------------------------------------- // Action handlers // ---------------------------------------------------------------------------