From 03555dd23434db7055c40c29ed16f5ec4cb94be6 Mon Sep 17 00:00:00 2001 From: Andrew Kuttig Date: Thu, 2 Apr 2026 18:41:21 -0600 Subject: [PATCH] Treat JSON-RPC error responses as non-fatal in apply_permission_mode AcpError::Protocol covers both real transport corruption and clean JSON-RPC error responses (e.g. -32601 'Method not found'). When an agent like amp-acp doesn't implement session/set_config_option, the error was treated as fatal, causing an infinite respawn loop. Move Protocol out of the fatal arm so it falls through to the warn-and-continue path. The harness falls back to per-tool auto-approval, which is the correct behavior. Amp-Thread-ID: https://ampcode.com/threads/T-019d4e6c-6235-76b4-aaf3-63baf10304d0 Co-authored-by: Amp --- crates/sprout-acp/src/pool.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/crates/sprout-acp/src/pool.rs b/crates/sprout-acp/src/pool.rs index 2415457406..b3f5075853 100644 --- a/crates/sprout-acp/src/pool.rs +++ b/crates/sprout-acp/src/pool.rs @@ -574,7 +574,6 @@ async fn apply_permission_mode( Ok(Err(e @ AcpError::Io(_))) | Ok(Err(e @ AcpError::WriteTimeout(_))) | Ok(Err(e @ AcpError::Timeout(_))) - | Ok(Err(e @ AcpError::Protocol(_))) | Ok(Err(e @ AcpError::AgentExited)) => { tracing::error!( target: "pool::permission", @@ -582,7 +581,10 @@ async fn apply_permission_mode( ); return Err(e); } - // Application-level errors — agent is fine, just uses default permission mode. + // Application-level errors (including JSON-RPC error responses like + // "method not found" which surface as AcpError::Protocol) — agent is + // fine, just doesn't support this config method. Fall back to + // per-tool auto-approval. Ok(Err(e)) => { tracing::warn!( target: "pool::permission",