Skip to content

fix: use single-arg limitedParallelism for coroutines 1.8 compat#77

Open
frninja wants to merge 1 commit intoagentclientprotocol:masterfrom
frninja:fix/limited-parallelism-compat
Open

fix: use single-arg limitedParallelism for coroutines 1.8 compat#77
frninja wants to merge 1 commit intoagentclientprotocol:masterfrom
frninja:fix/limited-parallelism-compat

Conversation

@frninja
Copy link

@frninja frninja commented Mar 5, 2026

Summary

  • Replace limitedParallelism(parallelism = 1, name = "MessageProcessor") with limitedParallelism(parallelism = 1) in Protocol.kt
  • The two-argument overload was added in kotlinx-coroutines 1.9.0, but IntelliJ Platform 2024.1–2025.1 bundles coroutines 1.7–1.8

Problem

When ACP SDK is used as an IntelliJ plugin dependency, Protocol constructor crashes at runtime:

java.lang.NoSuchMethodError: 'kotlinx.coroutines.CoroutineDispatcher 
  kotlinx.coroutines.CoroutineDispatcher.limitedParallelism(int, java.lang.String)'
    at com.agentclientprotocol.protocol.Protocol.<init>(Protocol.kt:130)

IntelliJ plugins must use the bundled coroutines library — they cannot bundle their own version. The bundled versions by IDE release:

IntelliJ Platform Bundled coroutines Has 2-arg limitedParallelism?
2024.1 1.7.3 No
2024.2–2025.1 1.8.0-intellij-* No
2025.2+ 1.10.1-intellij-* Yes

Fix

The name parameter is optional and purely for debugging. The single-argument limitedParallelism(Int) is available since coroutines 1.6.0 and works on all IntelliJ Platform versions.

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 <noreply@anthropic.com>
@frninja
Copy link
Author

frninja commented Mar 11, 2026

@nerzhulart Hi, Artem! Could you please take a look and merge? :)
Blocks us from using ACP SDK in plugins targeted to 2025.1 IntelliJ platform
Thanks,
Oleg

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant