set_status: reject multi-line and over-200-char text (#720)

This commit is contained in:
damocles 2026-05-31 11:50:49 +02:00 committed by Mara
commit 6c2cd078f1
4 changed files with 121 additions and 1 deletions

View file

@ -502,6 +502,12 @@ async fn dispatch(req: &ManagerRequest, coord: &Arc<Coordinator>) -> ManagerResp
}
}
ManagerRequest::SetStatus { text } => {
// #720: cap length + reject multi-line so a confused caller
// can't dump a multi-paragraph session report into the
// dashboard chip.
if let Err(message) = crate::limits::check_status_text(text) {
return ManagerResponse::Err { message };
}
let path = Coordinator::agent_notes_dir(MANAGER_AGENT).join("hyperhive-status");
let result = if text.trim().is_empty() {
std::fs::remove_file(&path).or_else(|e| {