aboutsummaryrefslogtreecommitdiff
path: root/src/detect/agents/opencode.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/opencode.rs
parenta7cd7806f2fa0251e2dca41ffec61ceafb6f0e18 (diff)
feat: use pty-first agent detection
Diffstat (limited to 'src/detect/agents/opencode.rs')
-rw-r--r--src/detect/agents/opencode.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/detect/agents/opencode.rs b/src/detect/agents/opencode.rs
index 219f69ed..ab8a424f 100644
--- a/src/detect/agents/opencode.rs
+++ b/src/detect/agents/opencode.rs
@@ -2,7 +2,7 @@ use super::super::{has_interrupt_pattern, AgentState};
pub(super) fn detect(content: &str) -> AgentState {
// Blocked
- if content.contains("△ Permission required") || has_opencode_question_prompt(content) {
+ if has_visible_blocker(content) {
return AgentState::Blocked;
}
@@ -17,6 +17,10 @@ pub(super) fn detect(content: &str) -> AgentState {
AgentState::Idle
}
+pub(super) fn has_visible_blocker(content: &str) -> bool {
+ content.contains("△ Permission required") || has_opencode_question_prompt(content)
+}
+
fn has_opencode_question_prompt(content: &str) -> bool {
let lower = content.to_lowercase();
let has_enter_action = lower.contains("enter confirm")