diff --git a/crates/colibri-daemon/src/socket.rs b/crates/colibri-daemon/src/socket.rs index fd3d5db..850ec35 100644 --- a/crates/colibri-daemon/src/socket.rs +++ b/crates/colibri-daemon/src/socket.rs @@ -1360,4 +1360,39 @@ mod tests { assert!(path.exists(), "live socket must not be removed"); let _ = std::fs::remove_dir_all(&dir); } + + #[test] + fn default_agent_args_zot_gets_rpc() { + assert_eq!(super::default_agent_args("zot"), vec!["rpc"]); + assert_eq!( + super::default_agent_args("/usr/local/bin/zot"), + vec!["rpc"], + "basename extraction must work for path-prefixed zot" + ); + } + + #[test] + fn default_agent_args_pi_gets_mode_json() { + assert_eq!(super::default_agent_args("pi"), vec!["--mode", "json"]); + assert_eq!( + super::default_agent_args("/usr/local/bin/pi"), + vec!["--mode", "json"], + "basename extraction must work for path-prefixed pi" + ); + } + + #[test] + fn default_agent_args_unknown_gets_mode_json() { + // Any binary that isn't zot gets the self-driving JSON mode. + // This is the safe default — unknown harnesses are assumed to be + // pi-compatible (--mode json), not zot-compatible (rpc). + assert_eq!( + super::default_agent_args("sample-pi-agent.py"), + vec!["--mode", "json"] + ); + assert_eq!( + super::default_agent_args("colibri-test-agent"), + vec!["--mode", "json"] + ); + } }