From cd9d71f7362c836f676048affdf86997ceabc5f3 Mon Sep 17 00:00:00 2001 From: Nathan Flurry Date: Tue, 17 Mar 2026 16:52:10 -0700 Subject: [PATCH] feat: [US-040] - Remove with_cdp method from BrowserRuntime Co-Authored-By: Claude Opus 4.6 (1M context) --- .../sandbox-agent/src/browser_runtime.rs | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/server/packages/sandbox-agent/src/browser_runtime.rs b/server/packages/sandbox-agent/src/browser_runtime.rs index da42fd3..4d17f02 100644 --- a/server/packages/sandbox-agent/src/browser_runtime.rs +++ b/server/packages/sandbox-agent/src/browser_runtime.rs @@ -560,23 +560,6 @@ impl BrowserRuntime { let _ = self.stop().await; } - /// Execute a closure with the CDP client while holding the state lock. - pub async fn with_cdp(&self, f: F) -> Result - where - F: FnOnce(&CdpClient) -> Fut, - Fut: std::future::Future>, - { - let state = self.inner.lock().await; - if state.state != BrowserState::Active { - return Err(BrowserProblem::not_active()); - } - let cdp = state - .cdp_client - .as_ref() - .ok_or_else(|| BrowserProblem::cdp_error("CDP client is not connected"))?; - f(cdp).await - } - /// Get an Arc-wrapped CDP client handle. /// /// Returns a cloned `Arc` after verifying the browser is active.