diff options
| author | Ogulcan Celik <ogulcancelik@gmail.com> | 2026-08-01 23:32:49 +0300 |
|---|---|---|
| committer | Ogulcan Celik <ogulcancelik@gmail.com> | 2026-08-01 23:33:27 +0300 |
| commit | 6fb0d803573353f031927a429828ab3b56c6c400 (patch) | |
| tree | 6588d7ef63b433d36b9596a4ee991f6e8bb44a60 /src | |
| parent | bd287b0158a4c11ff3844c2cf596b8bcb304a8ad (diff) | |
fix(detect): recognize opencode2 as opencode
refs #2169
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, |
