the runtime your coding agents live on
Rust agentagent-orchestrationaiai-agentsclaude-codeclicodexcoding-agentsdeveloper-toolsdevtoolsmultiplexerrustterminalterminal-multiplexerterminal-uitmuxtuiworkspace-manager
fix(detect): recognize opencode2 as opencode
Ogulcan Celik6fb0d8035733
diff --git a/docs/next/CHANGELOG.md b/docs/next/CHANGELOG.mdindex 724144170..6fcf7656a 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.rsindex 389407a25..29115dfff 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));@@ -1021,6 +1023,23 @@ mod tests {assert_eq!(identify_agent_in_job(&job), None);}+ #[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 {