diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/detect/mod.rs | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/src/detect/mod.rs b/src/detect/mod.rs index 389407a2..29115dff 100644 --- a/src/detect/mod.rs +++ b/src/detect/mod.rs @@ -186,7 +186,7 @@ fn lookup_agent(name: &str) -> Option<Agent> { "cline" => Some(Agent::Cline), "omp" => Some(Agent::Omp), "mastracode" | "mastra-code" | "mastra code" => Some(Agent::Mastracode), - "opencode" | "open-code" => Some(Agent::OpenCode), + "opencode" | "opencode2" | "open-code" => Some(Agent::OpenCode), "copilot" | "github-copilot" | "ghcs" => Some(Agent::GithubCopilot), "kimi" | "kimi-code" | "kimi code" => Some(Agent::Kimi), "kiro" | "kiro-cli" => Some(Agent::Kiro), @@ -675,6 +675,8 @@ mod tests { assert_eq!(identify_agent("mastra-code"), Some(Agent::Mastracode)); assert_eq!(identify_agent("opencode"), Some(Agent::OpenCode)); assert_eq!(identify_agent("opencode.exe"), Some(Agent::OpenCode)); + assert_eq!(identify_agent("opencode2"), Some(Agent::OpenCode)); + assert_eq!(identify_agent("opencode2.exe"), Some(Agent::OpenCode)); assert_eq!(identify_agent("kimi"), Some(Agent::Kimi)); assert_eq!(identify_agent("Kimi Code"), Some(Agent::Kimi)); assert_eq!(identify_agent("kiro"), Some(Agent::Kiro)); @@ -1022,6 +1024,23 @@ mod tests { } #[test] + fn identify_agent_in_job_detects_opencode2_as_opencode() { + let job = crate::platform::ForegroundJob { + process_group_id: 123, + processes: vec![foreground_process( + 123, + "opencode2", + &["opencode2", "--standalone"], + )], + }; + + assert_eq!( + identify_agent_in_job(&job), + Some((Agent::OpenCode, "opencode2".to_string())) + ); + } + + #[test] fn identify_agent_in_job_detects_opencode_exe_from_pnpm_package() { let job = crate::platform::ForegroundJob { process_group_id: 123, |
