aboutsummaryrefslogtreecommitdiff
path: root/src/detect/manifest
diff options
context:
space:
mode:
authorCan Celik <ogulcancelik@gmail.com>2026-08-28 17:04:39 +0300
committerGitHub <noreply@github.com>2026-08-28 17:04:39 +0300
commitf457cff4f2648eee85d176f8a41861241d4e8428 (patch)
tree95826d6f94e3705c72f7e77a45fc7148de33629f /src/detect/manifest
parent7b675f42af35508eab66ac42fe1598628597a893 (diff)
fix: ignore codex weak blockers above the current prompt (#3339)
refs #3301
Diffstat (limited to 'src/detect/manifest')
-rw-r--r--src/detect/manifest/tests.rs52
1 files changed, 48 insertions, 4 deletions
diff --git a/src/detect/manifest/tests.rs b/src/detect/manifest/tests.rs
index edffa2bb..508b9b7e 100644
--- a/src/detect/manifest/tests.rs
+++ b/src/detect/manifest/tests.rs
@@ -890,18 +890,62 @@ fn codex_screen_blocker_outranks_working_fallback() {
}
#[test]
-fn codex_weak_blocker_outranks_working_fallback() {
+fn codex_weak_blocker_without_current_prompt_is_blocked() {
+ let result = osc_explain(
+ Agent::Codex,
+ "do you want to continue? [y/n]\n",
+ "project",
+ "",
+ );
+
+ assert_eq!(result.state, AgentState::Blocked);
+ assert_eq!(
+ result.matched_rule.as_ref().map(|r| r.id.as_str()),
+ Some("weak_blocker")
+ );
+}
+
+#[test]
+fn codex_current_prompt_keeps_weak_text_from_overriding_working_fallback() {
let screen = "• Working (4s • esc to interrupt)\n\
do you want to continue? [y/n]\n\
› Use /skills to list available skills\n";
let result = osc_explain(Agent::Codex, screen, "project", "");
- assert_eq!(result.state, AgentState::Blocked);
+ assert_eq!(result.state, AgentState::Working);
assert_eq!(
result.matched_rule.as_ref().map(|r| r.id.as_str()),
- Some("weak_blocker")
+ Some("screen_working_fallback")
+ );
+ assert!(result.visible_working);
+}
+
+#[test]
+fn codex_weak_blocker_ignores_finished_response_above_current_prompt() {
+ let screen = "• The `wt rm` transcript now shows [y/N] / esc, matching the real prompt.\n\n\
+ ─ Worked for 4m 59s ─\n\n\
+ › Ask Codex to do anything\n";
+ let result = osc_explain(Agent::Codex, screen, "project", "");
+
+ assert_eq!(result.state, AgentState::Idle);
+ assert_eq!(
+ result.matched_rule.as_ref().map(|r| r.id.as_str()),
+ Some("osc_title_idle")
+ );
+}
+
+#[test]
+fn codex_weak_blocker_ignores_wrapped_current_prompt_text() {
+ let screen = "› Explain why this prompt wraps before quoting the confirmation text\n\
+ [y/N] / esc and whether the docs should include it\n\n\
+ gpt-5.6-sol default · /work\n";
+ let result = osc_explain(Agent::Codex, screen, "project", "");
+
+ assert_eq!(result.state, AgentState::Idle);
+ assert_eq!(
+ result.matched_rule.as_ref().map(|r| r.id.as_str()),
+ Some("osc_title_idle")
);
- assert!(!result.visible_working);
}
#[test]