From d477341e6af816ff4396042b084a0378ef437b4a Mon Sep 17 00:00:00 2001 From: Ogulcan Celik Date: Sat, 30 May 2026 23:54:41 +0300 Subject: refactor: split agent detection by agent Move screen detection into per-agent modules and keep visible-state arbitration centralized in terminal state. Tighten Codex prompt-scoped working detection and Claude hook/screen recovery for stale blocked and idle reports. Add a focused just recipe for single-test runs. refs #349 refs #352 --- src/detect/agents/cline.rs | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 src/detect/agents/cline.rs (limited to 'src/detect/agents/cline.rs') diff --git a/src/detect/agents/cline.rs b/src/detect/agents/cline.rs new file mode 100644 index 00000000..86b5ce01 --- /dev/null +++ b/src/detect/agents/cline.rs @@ -0,0 +1,22 @@ +use super::super::AgentState; + +pub(super) fn detect(content: &str) -> AgentState { + let lower = content.to_lowercase(); + + // Blocked + if lower.contains("let cline use this tool") { + return AgentState::Blocked; + } + // [act mode] or [plan mode] followed by "yes" + if (lower.contains("[act mode]") || lower.contains("[plan mode]")) && lower.contains("yes") { + return AgentState::Blocked; + } + + // Idle + if lower.contains("cline is ready for your message") { + return AgentState::Idle; + } + + // Cline defaults to working (unlike most agents that default to idle) + AgentState::Working +} -- cgit v1.2.3