aboutsummaryrefslogtreecommitdiff
path: root/src/detect/mod.rs
diff options
context:
space:
mode:
authorOgulcan Celik <ogulcancelik@gmail.com>2026-06-08 04:40:56 +0300
committerOgulcan Celik <ogulcancelik@gmail.com>2026-06-08 04:40:56 +0300
commite8acc76ef6d6c587a2b0c500ce02699344b9fe20 (patch)
treed1b016fdbb16cb09e9dee2484057a4c0cb6625c7 /src/detect/mod.rs
parent580db93eccc9f03cdc31841e294b8c18855013f6 (diff)
fix: detect truncated codex status rows
Diffstat (limited to 'src/detect/mod.rs')
-rw-r--r--src/detect/mod.rs32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/detect/mod.rs b/src/detect/mod.rs
index 1e3a2288..529574f9 100644
--- a/src/detect/mod.rs
+++ b/src/detect/mod.rs
@@ -1579,6 +1579,38 @@ mod tests {
}
#[test]
+ fn codex_truncated_status_with_arbitrary_label_is_visible_working() {
+ let detection = detect_agent(
+ Some(Agent::Codex),
+ "• Ran git diff -- src/detect/mod.rs\n └ diff output...\n\n• Considering patch updates (2m 26s • esc …\n\n\n› Fix Codex detection\n\n ~/Projects/herdr · master",
+ );
+
+ assert_eq!(detection.state, AgentState::Working);
+ assert!(detection.visible_working);
+ assert!(!detection.visible_idle);
+ }
+
+ #[test]
+ fn codex_truncated_status_without_prompt_is_working() {
+ assert_eq!(
+ detect_codex("• Considering patch updates (2m 26s • esc …"),
+ AgentState::Working
+ );
+ }
+
+ #[test]
+ fn codex_bullet_with_esc_text_without_timer_is_not_visible_working() {
+ let detection = detect_agent(
+ Some(Agent::Codex),
+ "• Notes mention esc to interrupt as a phrase\n\n› Fix Codex detection\n\n ~/Projects/herdr · master",
+ );
+
+ assert_eq!(detection.state, AgentState::Idle);
+ assert!(detection.visible_idle);
+ assert!(!detection.visible_working);
+ }
+
+ #[test]
fn codex_background_terminal_status_above_current_prompt_stays_working() {
let detection = detect_agent(
Some(Agent::Codex),