aboutsummaryrefslogtreecommitdiff
path: root/src/detect/manifest
diff options
context:
space:
mode:
authorJJ Liebig <jonathan.liebig@gmail.com>2026-09-24 02:23:42 +0200
committerGitHub <noreply@github.com>2026-09-24 02:23:42 +0200
commit9c96f7ddb3be2cc575a159d4d1f1d49fb10d7006 (patch)
tree182e89183981160397af301c075ab11316b15850 /src/detect/manifest
parent21fd121a63db53ff44b947bbe38c47bbf35e632c (diff)
fix: avoid inferring codex idle from terminal output (#4563)
refs #4507
Diffstat (limited to 'src/detect/manifest')
-rw-r--r--src/detect/manifest/tests.rs20
1 files changed, 12 insertions, 8 deletions
diff --git a/src/detect/manifest/tests.rs b/src/detect/manifest/tests.rs
index 07e9aa38..1e6b1a85 100644
--- a/src/detect/manifest/tests.rs
+++ b/src/detect/manifest/tests.rs
@@ -89,15 +89,21 @@ fn write_local_codex(content: &str) {
}
#[test]
-fn known_agent_no_match_defaults_to_idle_fallback() {
+fn codex_no_match_is_unknown_without_changing_other_agents() {
with_manifest_dirs("no-match", || {
write_local_codex(&local_manifest("working", "active-marker"));
let explain = explain(Agent::Codex, "unmatched-marker");
- assert_eq!(explain.state, AgentState::Idle);
+ assert_eq!(explain.state, AgentState::Unknown);
assert!(!explain.visible_idle);
assert_eq!(
explain.fallback_reason.as_deref(),
+ Some("codex_state_ambiguous")
+ );
+ let other = fallback_explain(Some(Agent::Pi), None, false);
+ assert_eq!(other.state, AgentState::Idle);
+ assert_eq!(
+ other.fallback_reason.as_deref(),
Some(DEFAULT_KNOWN_AGENT_IDLE_FALLBACK)
);
});
@@ -184,10 +190,10 @@ fn fallback_explain_preserves_active_manifest_version() {
let explain = explain(Agent::Codex, "ordinary prompt text");
- assert_eq!(explain.state, AgentState::Idle);
+ assert_eq!(explain.state, AgentState::Unknown);
assert_eq!(
explain.fallback_reason.as_deref(),
- Some(DEFAULT_KNOWN_AGENT_IDLE_FALLBACK)
+ Some("codex_state_ambiguous")
);
assert_eq!(explain.manifest_version.as_deref(), Some("9999.01.01.1"));
assert!(matches!(
@@ -267,10 +273,10 @@ fn detection_uses_cached_manifest_until_explicit_reload() {
write_remote_codex_without_reload(&remote_manifest("9999.01.01.2", "working", "new-ready"));
let unchanged = explain(Agent::Codex, "new-ready");
- assert_eq!(unchanged.state, AgentState::Idle);
+ assert_eq!(unchanged.state, AgentState::Unknown);
assert_eq!(
unchanged.fallback_reason.as_deref(),
- Some(DEFAULT_KNOWN_AGENT_IDLE_FALLBACK)
+ Some("codex_state_ambiguous")
);
assert_eq!(
unchanged.cached_remote_version.as_deref(),
@@ -479,8 +485,6 @@ contains = ["overlay-marker"]
assert!(!result.visible_working);
assert!(!result.visible_blocker);
assert!(detect(Agent::Codex, screen).skip_state_update);
- assert!(should_skip_state_update(Agent::Codex, screen));
- assert!(!should_skip_state_update(Agent::Codex, "activity-marker"));
});
}