use std::path::Path;
use std::process::Command;
pub(crate) fn build_codex_app_server_command(
folder: &Path,
model: &str,
policy: &ag_contracts::ExecutionPolicy,
) -> Command {
let mut command = Command::new("codex");
command.arg("--model").arg(model);
if let Some(limit) = policy.max_concurrent_subagents {
command
.arg("-c")
.arg(format!("agents.max_concurrent_threads_per_session={limit}"));
}
command
.arg("app-server")
.arg("--listen")
.arg("stdio://")
.current_dir(folder);
command
}
pub(crate) fn build_gemini_acp_command(folder: &Path, model: &str) -> Command {
let mut command = Command::new("gemini");
command
.arg("--acp")
.arg("--model")
.arg(model)
.current_dir(folder);
command
}