From 6369006545c8bee96d8442101b43b6896933cf2e Mon Sep 17 00:00:00 2001 From: Oleg Batashov Date: Thu, 5 Mar 2026 15:30:30 +0300 Subject: [PATCH] fix: use single-arg limitedParallelism for coroutines 1.8 compat MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The two-argument overload `limitedParallelism(Int, String)` was added in kotlinx-coroutines 1.9.0. IntelliJ Platform 2024.1–2025.1 bundles coroutines 1.7–1.8, causing NoSuchMethodError at runtime when ACP SDK is used as a plugin dependency. The `name` parameter is optional and purely for debugging. Dropping it restores compatibility with coroutines 1.6+ while keeping the same runtime behavior. Co-Authored-By: Claude Opus 4.6 --- .../kotlin/com/agentclientprotocol/protocol/Protocol.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/acp/src/commonMain/kotlin/com/agentclientprotocol/protocol/Protocol.kt b/acp/src/commonMain/kotlin/com/agentclientprotocol/protocol/Protocol.kt index 3286f0f..5293c15 100644 --- a/acp/src/commonMain/kotlin/com/agentclientprotocol/protocol/Protocol.kt +++ b/acp/src/commonMain/kotlin/com/agentclientprotocol/protocol/Protocol.kt @@ -127,7 +127,7 @@ public class Protocol( private val scope = CoroutineScope(parentScope.coroutineContext + SupervisorJob(parentScope.coroutineContext[Job]) + CoroutineName(options.protocolDebugName)) // a scope and dispatcher that executes requests to avoid blocking of message processing private val requestsScope = CoroutineScope(scope.coroutineContext + SupervisorJob(scope.coroutineContext[Job]) - + Dispatchers.Default.limitedParallelism(parallelism = 1, name = "MessageProcessor") + CoroutineName(options.protocolDebugName)) + + Dispatchers.Default.limitedParallelism(parallelism = 1) + CoroutineName(options.protocolDebugName)) // now the incoming and outgoing requests can clash by ids, but it should not be a problem private val requestIdCounter: AtomicInt = atomic(0) private val pendingOutgoingRequests: AtomicRef>> =