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
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue