aboutsummaryrefslogtreecommitdiff
path: root/src/detect
diff options
context:
space:
mode:
authorOgulcan Celik <ogulcancelik@gmail.com>2026-06-03 02:23:47 +0300
committerOgulcan Celik <ogulcancelik@gmail.com>2026-06-03 02:23:47 +0300
commit719dff6d3cefbe586403d5a8454b119df4ec3ccd (patch)
treec80ad70adc8d78df64ceefdf804aa1a4f5f1f246 /src/detect
parentb695d7cbc0d29540993642c23b3d5798cbf9f7dc (diff)
fix: detect claude arrow-glyph question prompts
Diffstat (limited to 'src/detect')
-rw-r--r--src/detect/agents/claude_code.rs5
-rw-r--r--src/detect/mod.rs10
2 files changed, 14 insertions, 1 deletions
diff --git a/src/detect/agents/claude_code.rs b/src/detect/agents/claude_code.rs
index 819dadf4..0918f5a2 100644
--- a/src/detect/agents/claude_code.rs
+++ b/src/detect/agents/claude_code.rs
@@ -99,7 +99,10 @@ fn has_live_blocked_form(content: &str) -> bool {
lower.contains("enter to select")
&& lower.contains("esc to cancel")
&& (lower.contains("tab/arrow keys to navigate")
- || lower.contains("arrow keys to navigate"))
+ || lower.contains("arrow keys to navigate")
+ || lower.contains("arrows to navigate")
+ || lower.contains("↑/↓ to navigate")
+ || lower.contains("↑↓ to navigate"))
})
}
diff --git a/src/detect/mod.rs b/src/detect/mod.rs
index ff27892b..a1084e06 100644
--- a/src/detect/mod.rs
+++ b/src/detect/mod.rs
@@ -1000,6 +1000,16 @@ mod tests {
}
#[test]
+ fn claude_question_form_with_arrow_glyph_footer_is_visible_blocker() {
+ let screen = "❯ this is a test can you use question otol to ask questiosns\n\n Thought for 16s (ctrl+o to expand)\n─────────────────────────────────────────────────────────────────────────────────────────\n ☐ Test type\n\nWhich kind of test question should I ask you next?\n\n❯ 1. Single choice\n Ask one multiple-choice question.\n 2. Multi choice\n Ask one question that allows several answers.\n 3. With preview\n Ask with side-by-side previews.\n 4. Type something.\n─────────────────────────────────────────────────────────────────────────────────────────\n 5. Chat about this\n\nEnter to select · ↑/↓ to navigate · Esc to cancel";
+ let detection = detect_agent(Some(Agent::Claude), screen);
+
+ assert_eq!(detection.state, AgentState::Blocked);
+ assert!(detection.visible_blocker);
+ assert!(!detection.visible_idle);
+ }
+
+ #[test]
fn claude_question_form_selected_bottom_is_visible_blocker() {
let screen = "❯ ask again\n─────────────────────────────────────────────────────────────────────────────────────────\n← ☐ Subject ☐ Tone ✔ Submit →\n\nWhat should I ask you about?\n\n 1. Today\n Your current plan or priority.\n 2. Project\n A codebase, feature, bug, or PR.\n 3. Preference\n How you want me to work with you.\n 4. Random\n A casual question with no work context.\n 5. Type something.\n─────────────────────────────────────────────────────────────────────────────────────────\n❯ 6. Chat about this\n\nEnter to select · Tab/Arrow keys to navigate · ctrl+g to edit in Zed · Esc to cancel";
let detection = detect_agent(Some(Agent::Claude), screen);