aboutsummaryrefslogtreecommitdiff
path: root/src/detect/mod.rs
diff options
context:
space:
mode:
authorOgulcan Celik <ogulcancelik@gmail.com>2026-06-19 03:32:53 +0300
committerOgulcan Celik <ogulcancelik@gmail.com>2026-06-19 03:32:53 +0300
commit26c5f97a908c1ebe4228302d1b9e8c5423b2ab75 (patch)
tree43b7aaff6796451ffe2d13d9503ed58bf604e0d7 /src/detect/mod.rs
parent9f4f1630893f74697a2097ef11bf5bf512a37850 (diff)
fix: reanchor lifecycle hook generations
refs #684
Diffstat (limited to 'src/detect/mod.rs')
-rw-r--r--src/detect/mod.rs26
1 files changed, 25 insertions, 1 deletions
diff --git a/src/detect/mod.rs b/src/detect/mod.rs
index 66443877..c8292ab2 100644
--- a/src/detect/mod.rs
+++ b/src/detect/mod.rs
@@ -49,6 +49,7 @@ pub enum Agent {
Devin,
Antigravity,
Cline,
+ Omp,
OpenCode,
GithubCopilot,
Kimi,
@@ -62,7 +63,7 @@ pub enum Agent {
}
impl Agent {
- pub const ALL: [Self; 18] = [
+ pub const SCREEN_MANIFEST_AGENTS: [Self; 18] = [
Self::Pi,
Self::Claude,
Self::Codex,
@@ -94,6 +95,7 @@ pub fn agent_label(agent: Agent) -> &'static str {
Agent::Devin => "devin",
Agent::Antigravity => "agy",
Agent::Cline => "cline",
+ Agent::Omp => "omp",
Agent::OpenCode => "opencode",
Agent::GithubCopilot => "copilot",
Agent::Kimi => "kimi",
@@ -118,6 +120,7 @@ pub fn parse_agent_label(agent: &str) -> Option<Agent> {
"devin" | "devin-cli" | "devin cli" => Some(Agent::Devin),
"agy" | "antigravity" | "antigravity-cli" => Some(Agent::Antigravity),
"cline" => Some(Agent::Cline),
+ "omp" => Some(Agent::Omp),
"opencode" | "open-code" => Some(Agent::OpenCode),
"copilot" | "github-copilot" | "ghcs" => Some(Agent::GithubCopilot),
"kimi" | "kimi-code" | "kimi code" => Some(Agent::Kimi),
@@ -146,6 +149,7 @@ pub fn identify_agent(process_name: &str) -> Option<Agent> {
"devin" | "devin-cli" | "devin cli" => Some(Agent::Devin),
"agy" | "antigravity" | "antigravity-cli" => Some(Agent::Antigravity),
"cline" => Some(Agent::Cline),
+ "omp" => Some(Agent::Omp),
"opencode" | "open-code" => Some(Agent::OpenCode),
"copilot" | "github-copilot" | "ghcs" => Some(Agent::GithubCopilot),
"kimi" | "kimi-code" | "kimi code" => Some(Agent::Kimi),
@@ -592,6 +596,7 @@ mod tests {
assert_eq!(identify_agent("agy"), Some(Agent::Antigravity));
assert_eq!(identify_agent("antigravity-cli"), Some(Agent::Antigravity));
assert_eq!(identify_agent("cline"), Some(Agent::Cline));
+ assert_eq!(identify_agent("omp"), Some(Agent::Omp));
assert_eq!(identify_agent("opencode"), Some(Agent::OpenCode));
assert_eq!(identify_agent("opencode.exe"), Some(Agent::OpenCode));
assert_eq!(identify_agent("kimi"), Some(Agent::Kimi));
@@ -616,6 +621,7 @@ mod tests {
assert_eq!(parse_agent_label("devin-cli"), Some(Agent::Devin));
assert_eq!(parse_agent_label("agy"), Some(Agent::Antigravity));
assert_eq!(parse_agent_label("antigravity"), Some(Agent::Antigravity));
+ assert_eq!(parse_agent_label("omp"), Some(Agent::Omp));
assert_eq!(parse_agent_label("opencode.exe"), Some(Agent::OpenCode));
assert_eq!(parse_agent_label("copilot"), Some(Agent::GithubCopilot));
assert_eq!(parse_agent_label("kimi-code"), Some(Agent::Kimi));
@@ -637,6 +643,7 @@ mod tests {
assert_eq!(agent_label(Agent::OpenCode), "opencode");
assert_eq!(agent_label(Agent::Devin), "devin");
assert_eq!(agent_label(Agent::Antigravity), "agy");
+ assert_eq!(agent_label(Agent::Omp), "omp");
assert_eq!(agent_label(Agent::Kiro), "kiro");
assert_eq!(agent_label(Agent::Grok), "grok");
assert_eq!(agent_label(Agent::Hermes), "hermes");
@@ -759,6 +766,23 @@ mod tests {
}
#[test]
+ fn identify_agent_in_job_detects_bun_wrapped_omp() {
+ let job = crate::platform::ForegroundJob {
+ process_group_id: 123,
+ processes: vec![foreground_process(
+ 123,
+ "bun",
+ &["bun", "/home/can/.bun/bin/omp"],
+ )],
+ };
+
+ assert_eq!(
+ identify_agent_in_job(&job),
+ Some((Agent::Omp, "omp".to_string()))
+ );
+ }
+
+ #[test]
fn identify_agent_in_job_detects_windows_cmd_wrapped_codex() {
let job = crate::platform::ForegroundJob {
process_group_id: 123,