diff options
| author | Ogulcan Celik <ogulcancelik@gmail.com> | 2026-04-14 18:13:08 +0300 |
|---|---|---|
| committer | Ogulcan Celik <ogulcancelik@gmail.com> | 2026-04-14 18:13:08 +0300 |
| commit | 6c8e521bd3dc810b378ecddd2b60627d7390747d (patch) | |
| tree | e5109cd86784429fa6a5f598ebd1a3e2a5d8b270 /src/detect.rs | |
| parent | 8cac2c0df47af927b1c467fb8449d8f84e210407 (diff) | |
fix treat droid mission control as idle
Diffstat (limited to 'src/detect.rs')
| -rw-r--r-- | src/detect.rs | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/src/detect.rs b/src/detect.rs index 237d7270..178fe0a5 100644 --- a/src/detect.rs +++ b/src/detect.rs @@ -318,6 +318,10 @@ fn detect_kimi(content: &str) -> AgentState { fn detect_droid(content: &str) -> AgentState { let lower = content.to_lowercase(); + if is_droid_mission_control(content, &lower) { + return AgentState::Idle; + } + // Blocked: EXECUTE approval prompt with selection UI chrome // Primary (AND): structural keyword + chrome text = certain let has_execute = content.contains("EXECUTE"); @@ -347,6 +351,20 @@ fn detect_droid(content: &str) -> AgentState { AgentState::Idle } +fn is_droid_mission_control(content: &str, lower_content: &str) -> bool { + let has_header = lower_content.contains("mission control"); + let has_active_feature = lower_content.contains("active feature"); + let has_feature_summary = lower_content.contains("features "); + let has_mission_metrics = lower_content.contains("time ") + && lower_content.contains("input ") + && lower_content.contains("output "); + + content.contains("⛬") + && has_header + && has_active_feature + && (has_feature_summary || has_mission_metrics) +} + /// Amp (Sourcegraph) detection. /// /// Blocked approval prompts use a shared footer with options like @@ -1062,6 +1080,24 @@ mod tests { } #[test] + fn droid_mission_control_is_idle_even_with_stop_chrome() { + let screen = concat!( + "⛬ Mission Control ~/Projects/herdr-worktrees/persistence TIME 22h 40m · Input 12.6M · Cached 129.7M · Output 471.5K\n", + "● RUNNING\n", + "Active Feature fix-scrutiny-misc-followups\n", + "Features 25/28\n", + "(Press ESC to stop)\n", + ); + assert_eq!(detect_droid(screen), AgentState::Idle); + } + + #[test] + fn droid_leaves_mission_control_and_returns_to_working() { + let screen = "> how u doin\n\n⠴ Thinking... (Press ESC to stop)\n\nAuto (Off)"; + assert_eq!(detect_droid(screen), AgentState::Working); + } + + #[test] fn droid_braille_spinner_detected() { assert!(has_braille_spinner("⠴ Thinking...")); assert!(has_braille_spinner(" ⠧ Loading...")); |
