aboutsummaryrefslogtreecommitdiff
path: root/src/detect/agents/qodercli.rs
diff options
context:
space:
mode:
authorOgulcan Celik <ogulcancelik@gmail.com>2026-06-08 20:55:51 +0300
committerOgulcan Celik <ogulcancelik@gmail.com>2026-06-09 04:26:19 +0300
commitee51c5e5fbaea694e65bb0a4908f75bcaf9707d1 (patch)
treef566d2a5921d4112602a7abcffb5cf6eb04d5f24 /src/detect/agents/qodercli.rs
parenta7cd7806f2fa0251e2dca41ffec61ceafb6f0e18 (diff)
feat: use pty-first agent detection
Diffstat (limited to 'src/detect/agents/qodercli.rs')
-rw-r--r--src/detect/agents/qodercli.rs14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/detect/agents/qodercli.rs b/src/detect/agents/qodercli.rs
index b7da356b..0a4372df 100644
--- a/src/detect/agents/qodercli.rs
+++ b/src/detect/agents/qodercli.rs
@@ -15,7 +15,7 @@ pub(super) fn detect(content: &str) -> AgentState {
return AgentState::Idle;
}
- if has_qodercli_blocked_prompt(&lower) {
+ if has_visible_blocker(content) {
return AgentState::Blocked;
}
@@ -87,9 +87,15 @@ fn has_qodercli_spinner_row(content: &str) -> bool {
/// defensive fallbacks in case the title row scrolls off-screen.
/// * The interactive shell waiting hint emitted by qodercli when an agent
/// spawns a shell that is now parked for user keystrokes.
-fn has_qodercli_blocked_prompt(lower_content: &str) -> bool {
- lower_content.contains("waiting for user confirmation")
- || lower_content.contains("awaiting approval")
+pub(super) fn has_visible_blocker(content: &str) -> bool {
+ let lower_content = content.to_lowercase();
+ (lower_content.contains("waiting for user confirmation")
+ && (lower_content.contains("yes")
+ || lower_content.contains("no")
+ || lower_content.contains("allow")
+ || lower_content.contains("reject")))
+ || (lower_content.contains("awaiting approval")
+ && (lower_content.contains("allow") || lower_content.contains("reject")))
|| lower_content.contains("permission required")
|| lower_content.contains("allow once or always?")
|| lower_content.contains("asking user")