From 27a028aeae0b2ecdd747c90aa34605fd7e810ef1 Mon Sep 17 00:00:00 2001 From: Ogulcan Celik Date: Mon, 8 Jun 2026 02:55:23 +0300 Subject: fix: detect codex interrupt status headers refs #501 --- src/detect/agents/codex.rs | 1 + src/detect/mod.rs | 12 ++++++++++++ 2 files changed, 13 insertions(+) (limited to 'src') diff --git a/src/detect/agents/codex.rs b/src/detect/agents/codex.rs index 9870bca6..a53d9358 100644 --- a/src/detect/agents/codex.rs +++ b/src/detect/agents/codex.rs @@ -152,6 +152,7 @@ fn codex_working_status_line(line: &str) -> bool { trimmed.starts_with('•') && (trimmed.contains("Working (") || trimmed.contains("Waiting for background terminal (") + || lower.contains(" • esc to interrupt") || lower.contains("reviewing approval request (") || (lower.contains("reviewing ") && lower.contains(" approval requests (")) || trimmed.contains("Booting MCP server:")) diff --git a/src/detect/mod.rs b/src/detect/mod.rs index 0c7ad943..1e3a2288 100644 --- a/src/detect/mod.rs +++ b/src/detect/mod.rs @@ -1566,6 +1566,18 @@ mod tests { assert!(!detection.visible_idle); } + #[test] + fn codex_generic_interrupt_status_above_current_prompt_stays_working() { + let detection = detect_agent( + Some(Agent::Codex), + "• I need to inspect more code first.\n\n• Investigating code output (44s • esc to interrupt)\n\n\n› Summarize recent commits\n\n gpt-5.5 high · ~/Codes/herdr", + ); + + assert_eq!(detection.state, AgentState::Working); + assert!(detection.visible_working); + assert!(!detection.visible_idle); + } + #[test] fn codex_background_terminal_status_above_current_prompt_stays_working() { let detection = detect_agent( -- cgit v1.2.3