refactor(web_ui): Bus::effective_context_window, sigint_claude + per-connection hello, relocate fetch_reminder_stats, drop redundant guard
This commit is contained in:
parent
77f31b44bb
commit
9cebc128e2
7 changed files with 63 additions and 49 deletions
|
|
@ -5,7 +5,6 @@ use axum::http::StatusCode;
|
|||
use axum::response::{IntoResponse, Response};
|
||||
use serde::Deserialize;
|
||||
|
||||
use super::state::fetch_reminder_stats;
|
||||
use super::{AppState, error_response};
|
||||
|
||||
#[derive(Deserialize)]
|
||||
|
|
@ -27,6 +26,27 @@ pub(super) async fn api_stats(
|
|||
axum::Json(snapshot)
|
||||
}
|
||||
|
||||
/// Fetch reminder activity stats from the broker via the per-agent / manager
|
||||
/// socket. Returns None on any transport / decode failure — the stats are
|
||||
/// decorative, not authoritative.
|
||||
async fn fetch_reminder_stats(
|
||||
socket: &std::path::Path,
|
||||
window_secs: u64,
|
||||
) -> Option<hive_sh4re::ReminderStats> {
|
||||
match super::broker_request(
|
||||
socket,
|
||||
&hive_sh4re::Request::ReminderRollup {
|
||||
since_secs: window_secs,
|
||||
agent: None,
|
||||
},
|
||||
)
|
||||
.await
|
||||
{
|
||||
Ok(hive_sh4re::Response::ReminderRollup(stats)) => Some(stats),
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
|
||||
/// Proxy this agent's loose-ends list via the per-agent socket. The
|
||||
/// web UI surfaces the result as a collapsible section in the page
|
||||
/// so the operator can see at a glance what's pending against the
|
||||
|
|
|
|||
Loading…
Reference in a new issue