From 72770305d388fd5ec247493e05a89b686c6d0026 Mon Sep 17 00:00:00 2001 From: Ogulcan Celik Date: Sat, 16 May 2026 02:26:14 +0300 Subject: feat: add hook-owned custom agent status labels --- src/app/api_helpers.rs | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/app/api_helpers.rs') diff --git a/src/app/api_helpers.rs b/src/app/api_helpers.rs index 011e5ccb..56907ece 100644 --- a/src/app/api_helpers.rs +++ b/src/app/api_helpers.rs @@ -90,3 +90,12 @@ pub(super) fn normalize_reported_agent_label(agent: &str) -> Option { } Some(trimmed.to_string()) } + +pub(super) fn normalize_custom_status(status: Option) -> Option { + let trimmed = status?.trim().to_string(); + let mut normalized = String::new(); + for ch in trimmed.chars().filter(|ch| !ch.is_control()).take(32) { + normalized.push(ch); + } + (!normalized.trim().is_empty()).then(|| normalized.trim().to_string()) +} -- cgit v1.2.3