From f1c9a4d1b97653f058eca6eac07ca2709659f8c4 Mon Sep 17 00:00:00 2001 From: BestCodes <106822363+The-Best-Codes@users.noreply.github.com> Date: Mon, 9 Mar 2026 09:23:36 -0500 Subject: [PATCH] fix: preserve pairings when stopping gateway (#7733) Signed-off-by: The-Best-Codes <106822363+The-Best-Codes@users.noreply.github.com> --- crates/goose/src/gateway/manager.rs | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) diff --git a/crates/goose/src/gateway/manager.rs b/crates/goose/src/gateway/manager.rs index 423ca6cf7e..192398c384 100644 --- a/crates/goose/src/gateway/manager.rs +++ b/crates/goose/src/gateway/manager.rs @@ -121,7 +121,7 @@ impl GatewayManager { Ok(()) } - /// Stop a gateway and clear its pairings. Config is kept so it can be restarted. + /// Stop a gateway while preserving pairings so it can be restarted. pub async fn stop_gateway(&self, gateway_type: &str) -> anyhow::Result<()> { let instance = self .gateways @@ -133,20 +133,6 @@ impl GatewayManager { instance.cancel.cancel(); let _ = instance.handle.await; - match self - .pairing_store - .remove_all_for_platform(gateway_type) - .await - { - Ok(count) if count > 0 => { - tracing::info!(gateway = %gateway_type, count, "cleared pairings on stop"); - } - Err(e) => { - tracing::warn!(gateway = %gateway_type, error = %e, "failed to clear pairings on stop"); - } - _ => {} - } - tracing::info!(gateway = %gateway_type, "gateway stopped"); Ok(()) } @@ -239,13 +225,6 @@ impl GatewayManager { for (gateway_type, instance) in instances { instance.cancel.cancel(); let _ = instance.handle.await; - if let Err(e) = self - .pairing_store - .remove_all_for_platform(&gateway_type) - .await - { - tracing::warn!(gateway = %gateway_type, error = %e, "failed to clear pairings on stop"); - } tracing::info!(gateway = %gateway_type, "gateway stopped"); } }