diff --git a/lib/crates/fabro-cli/src/commands/run/attach.rs b/lib/crates/fabro-cli/src/commands/run/attach.rs index 9ebb1eb9c..417cf80b6 100644 --- a/lib/crates/fabro-cli/src/commands/run/attach.rs +++ b/lib/crates/fabro-cli/src/commands/run/attach.rs @@ -580,10 +580,7 @@ mod tests { .header("Content-Type", "application/json") .body(terminal_run_state_response().to_string()); }); - let client = - server_client::connect_server_target_direct(&format!("{}/api/v1", server.base_url())) - .await - .unwrap(); + let client = server_client::ServerStoreClient::new_no_proxy(&server.base_url()).unwrap(); handle_detach_signal(&client, &run_id, true).await; diff --git a/lib/crates/fabro-cli/src/server_client.rs b/lib/crates/fabro-cli/src/server_client.rs index 4e8234dbd..14b86167e 100644 --- a/lib/crates/fabro-cli/src/server_client.rs +++ b/lib/crates/fabro-cli/src/server_client.rs @@ -272,6 +272,18 @@ struct ArtifactBatchUploadEntry { } impl ServerStoreClient { + /// Build a client for tests that bypasses proxy discovery. + #[cfg(test)] + pub(crate) fn new_no_proxy(base_url: &str) -> Result { + let http_client = cli_http_client_builder().no_proxy().build()?; + let client = fabro_api::Client::new_with_client(base_url, http_client.clone()); + Ok(Self { + client, + http_client, + base_url: base_url.to_string(), + }) + } + pub(crate) fn clone_for_reuse(&self) -> Self { self.clone() }