fix treat droid mission control as idle

This commit is contained in:
Ogulcan Celik
2026-04-14 18:13:08 +03:00
parent 8cac2c0df4
commit 6c8e521bd3
+36
View File
@@ -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
@@ -1061,6 +1079,24 @@ mod tests {
assert_eq!(detect_droid(screen), AgentState::Idle);
}
#[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..."));