From ee51c5e5fbaea694e65bb0a4908f75bcaf9707d1 Mon Sep 17 00:00:00 2001 From: Ogulcan Celik Date: Mon, 8 Jun 2026 20:55:51 +0300 Subject: feat: use pty-first agent detection --- src/detect/agents/cline.rs | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'src/detect/agents/cline.rs') diff --git a/src/detect/agents/cline.rs b/src/detect/agents/cline.rs index 86b5ce01..13509606 100644 --- a/src/detect/agents/cline.rs +++ b/src/detect/agents/cline.rs @@ -4,11 +4,7 @@ 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") { + if has_visible_blocker(content) { return AgentState::Blocked; } @@ -20,3 +16,11 @@ pub(super) fn detect(content: &str) -> AgentState { // Cline defaults to working (unlike most agents that default to idle) AgentState::Working } + +pub(super) fn has_visible_blocker(content: &str) -> bool { + let lower = content.to_lowercase(); + lower.contains("let cline use this tool") + || ((lower.contains("[act mode]") || lower.contains("[plan mode]")) + && (lower.contains("execute command?") || lower.contains("use this tool?")) + && lower.contains("yes")) +} -- cgit v1.2.3