refactor(web_ui): Bus::effective_context_window, sigint_claude + per-connection hello, relocate fetch_reminder_stats, drop redundant guard

This commit is contained in:
müde 2026-07-05 22:47:14 +02:00
commit 9cebc128e2
7 changed files with 63 additions and 49 deletions

View file

@ -259,6 +259,17 @@ fn read_gui_vnc_port() -> Option<u16> {
std::env::var("HIVE_GUI_VNC_PORT").ok()?.parse().ok()
}
/// SIGINT any running `claude` process in this container (best-effort). Shared
/// by `/api/cancel` and `/api/logout`. Returns the `pkill` `Output` so callers
/// can inspect the exit status (0 = signalled, 1 = no process matched) or
/// ignore it.
async fn sigint_claude() -> std::io::Result<std::process::Output> {
tokio::process::Command::new("pkill")
.args(["-INT", "claude"])
.output()
.await
}
fn error_response(status: StatusCode, message: &str) -> Response {
// Plain text — JS app surfaces in `alert()`, HTML wrapping would just
// be noise. Status is per-caller: 400 for bad input, 409 for a