diff options
| author | Ogulcan Celik <ogulcancelik@gmail.com> | 2026-06-03 19:21:07 +0300 |
|---|---|---|
| committer | Ogulcan Celik <ogulcancelik@gmail.com> | 2026-06-03 19:21:50 +0300 |
| commit | 5c86f0660f538553850e2c8fb0493372a48cb511 (patch) | |
| tree | 7715866a3a57ace0730eb6acbce75a95dc895fdb /src/detect/agents/claude_code.rs | |
| parent | f5e66b251fa8ec24989bf25861bcf4e38a561470 (diff) | |
fix: avoid claude custom status false blocked
refs #409
Diffstat (limited to 'src/detect/agents/claude_code.rs')
| -rw-r--r-- | src/detect/agents/claude_code.rs | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/src/detect/agents/claude_code.rs b/src/detect/agents/claude_code.rs index 77db856c..d2f12552 100644 --- a/src/detect/agents/claude_code.rs +++ b/src/detect/agents/claude_code.rs @@ -100,7 +100,6 @@ fn has_claude_blocked_prompt(content: &str, lower_content: &str) -> bool { || lower_content.contains("do you want to allow this connection?") || lower_content.contains("tab to amend") || lower_content.contains("ctrl+e to explain") - || lower_content.contains("chat about this") || lower_content.contains("review your answers") || lower_content.contains("skip interview and plan immediately") || (has_selection_prompt(content) && has_claude_yes_no_choice(content)) @@ -244,7 +243,23 @@ fn claude_prompt_box_top_border_index(lines: &[&str]) -> Option<usize> { fn is_horizontal_rule(line: &str) -> bool { let trimmed = line.trim(); - !trimmed.is_empty() && trimmed.chars().all(|c| c == '─') + if trimmed.is_empty() { + return false; + } + + let rule_chars = trimmed.chars().take_while(|&c| c == '─').count(); + if rule_chars == 0 { + return false; + } + + let rule_bytes = trimmed + .char_indices() + .nth(rule_chars) + .map(|(index, _)| index) + .unwrap_or(trimmed.len()); + let suffix = trimmed[rule_bytes..].trim_start(); + + suffix.is_empty() || rule_chars >= 3 } fn bottom_non_empty_lines(content: &str, max_lines: usize) -> Vec<&str> { |
