From a2b595311377357bd7cb799a128e5994a6413a3b Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 21 Apr 2026 18:00:25 +0000 Subject: [PATCH 1/3] Initial plan From 0f9298df9ca6d0c50253b94365265c47219e45e9 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 21 Apr 2026 18:08:38 +0000 Subject: [PATCH 2/3] fix: gate run command to debug builds Agent-Logs-Url: https://github.com/githubnext/ado-aw/sessions/c08d9a10-a94d-471d-a894-87264437e5cf Co-authored-by: jamesadevine <4742697+jamesadevine@users.noreply.github.com> --- src/main.rs | 4 ++++ tests/cli_tests.rs | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 tests/cli_tests.rs diff --git a/src/main.rs b/src/main.rs index e2d13f84..72ce62b5 100644 --- a/src/main.rs +++ b/src/main.rs @@ -11,6 +11,7 @@ mod logging; mod mcp; mod ndjson; pub mod runtimes; +#[cfg(debug_assertions)] mod run; pub mod sanitize; mod safeoutputs; @@ -130,6 +131,7 @@ enum Commands { definition_ids: Option>, }, /// Run agent locally (local development mode) + #[cfg(debug_assertions)] Run { /// Path to the agent markdown file path: String, @@ -180,6 +182,7 @@ async fn main() -> Result<()> { Some(Commands::McpHttp { .. }) => "mcp-http", Some(Commands::Init { .. }) => "init", Some(Commands::Configure { .. }) => "configure", + #[cfg(debug_assertions)] Some(Commands::Run { .. }) => "run", None => "ado-aw", }; @@ -387,6 +390,7 @@ async fn main() -> Result<()> { ) .await?; } + #[cfg(debug_assertions)] Commands::Run { path, pat, diff --git a/tests/cli_tests.rs b/tests/cli_tests.rs new file mode 100644 index 00000000..dacffc43 --- /dev/null +++ b/tests/cli_tests.rs @@ -0,0 +1,35 @@ +use std::path::PathBuf; + +#[cfg(debug_assertions)] +#[test] +fn test_run_subcommand_exposed_in_debug_builds() { + let binary_path = PathBuf::from(env!("CARGO_BIN_EXE_ado-aw")); + let output = std::process::Command::new(&binary_path) + .arg("--help") + .output() + .expect("Failed to run ado-aw --help"); + + assert!(output.status.success(), "--help should succeed"); + let stdout = String::from_utf8_lossy(&output.stdout); + assert!( + stdout.contains("run") && stdout.contains("Run agent locally"), + "Debug build help output should include the run subcommand, got:\n{stdout}" + ); +} + +#[cfg(not(debug_assertions))] +#[test] +fn test_run_subcommand_not_exposed_in_release_builds() { + let binary_path = PathBuf::from(env!("CARGO_BIN_EXE_ado-aw")); + let output = std::process::Command::new(&binary_path) + .arg("--help") + .output() + .expect("Failed to run ado-aw --help"); + + assert!(output.status.success(), "--help should succeed"); + let stdout = String::from_utf8_lossy(&output.stdout); + assert!( + !stdout.contains("Run agent locally"), + "Release build help output should not include the run subcommand, got:\n{stdout}" + ); +} From 05aa9d01cf68ad910dbae0bbf578982e600d289e Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 21 Apr 2026 19:41:11 +0000 Subject: [PATCH 3/3] test: simplify redundant debug help assertion Agent-Logs-Url: https://github.com/githubnext/ado-aw/sessions/4e6537f2-692b-4547-bd49-149c05e8baa6 Co-authored-by: jamesadevine <4742697+jamesadevine@users.noreply.github.com> --- tests/cli_tests.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/cli_tests.rs b/tests/cli_tests.rs index dacffc43..b7e48989 100644 --- a/tests/cli_tests.rs +++ b/tests/cli_tests.rs @@ -12,7 +12,7 @@ fn test_run_subcommand_exposed_in_debug_builds() { assert!(output.status.success(), "--help should succeed"); let stdout = String::from_utf8_lossy(&output.stdout); assert!( - stdout.contains("run") && stdout.contains("Run agent locally"), + stdout.contains("Run agent locally"), "Debug build help output should include the run subcommand, got:\n{stdout}" ); }