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 | |
| parent | bd287b0158a4c11ff3844c2cf596b8bcb304a8ad (diff) | |
fix(detect): recognize opencode2 as opencode
refs #2169
| -rw-r--r-- | docs/next/CHANGELOG.md | 1 | ||||
| -rw-r--r-- | src/detect/mod.rs | 21 |
2 files changed, 21 insertions, 1 deletions
diff --git a/docs/next/CHANGELOG.md b/docs/next/CHANGELOG.md index 72414417..6fcf7656 100644 --- a/docs/next/CHANGELOG.md +++ b/docs/next/CHANGELOG.md @@ -12,6 +12,7 @@ - Relicensed Herdr from AGPL-3.0-or-later to Apache-2.0. ### Fixed +- OpenCode 2 preview panes now appear as OpenCode agents and use the existing OpenCode status detection. (#2169) - Pane text copied through VS Code Remote Tunnels now reaches the viewing machine's clipboard instead of overwriting the remote host clipboard. (#2015) - Windows agent detection now follows Git Bash-launched agents across emulated `exec` process boundaries. (#2107) - Detached Windows servers and pane processes now survive logout from the OpenSSH session that started them. (#2008) 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, |
