From f18bee9f5c43e56ebdcb7e5fad17f3236de4d08e Mon Sep 17 00:00:00 2001 From: Ogulcan Celik Date: Mon, 8 Jun 2026 21:52:48 +0300 Subject: fix: smooth agent status transitions --- src/detect/agents/claude_code.rs | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'src/detect/agents/claude_code.rs') diff --git a/src/detect/agents/claude_code.rs b/src/detect/agents/claude_code.rs index a13019a4..1336c480 100644 --- a/src/detect/agents/claude_code.rs +++ b/src/detect/agents/claude_code.rs @@ -59,6 +59,29 @@ pub(super) fn has_visible_blocker(content: &str) -> bool { || lower.contains("ctrl+e to explain")) } +pub(in crate::detect) fn has_idle_recap_notice(content: &str) -> bool { + if !has_prompt_box(content) || has_visible_blocker(content) { + return false; + } + + let above_prompt = content_above_prompt_box(content); + let bottom_lines = bottom_non_empty_lines(above_prompt, 8); + let Some(last_line) = bottom_lines.last() else { + return false; + }; + if !last_line + .to_ascii_lowercase() + .contains("(disable recaps in /config)") + { + return false; + } + let bottom = normalize_lines(&bottom_lines).to_ascii_lowercase(); + + bottom.contains("※ recap:") + && !bottom.contains("esc to interrupt") + && !bottom.contains("ctrl+c to interrupt") +} + pub(super) fn has_working_chrome(content: &str) -> bool { let above = content_above_prompt_box(content); let above_lower = above.to_lowercase(); -- cgit v1.2.3