Fixes an IntelliJ UI freeze when switching between external ACP agent…#1213
Merged
carlrobertoh merged 1 commit intocarlrobertoh:masterfrom Apr 20, 2026
Merged
Fixes an IntelliJ UI freeze when switching between external ACP agent…#1213carlrobertoh merged 1 commit intocarlrobertoh:masterfrom
carlrobertoh merged 1 commit intocarlrobertoh:masterfrom
Conversation
…s such as OpenCode and Codex in the ProxyAI agent runtime selector. Problem: `closeSession()` was called synchronously from the runtime selector action path. Closing an active ACP session can block while closing stdio transport streams. In practice this can park the Swing UI thread in `AcpProtocolCore.close()` / `StdioTransport.close()`, leaving IntelliJ black-screened until the child ACP process is killed externally. A freeze report captured the EDT stuck under: - `AgentModelComboBoxAction.actionPerformed` - `ExternalAcpAgentService.closeSession` - `AcpProcessState.close` - `AcpProtocolCore.close` - `StdioTransport.close` - `FileDescriptor.close0` Changes: - Close removed ACP process states asynchronously on the service IO scope. - Remove the session setup mutex immediately after removing the state. - Stop the child ACP process before closing the protocol. - Force-kill the child process if it does not exit shortly after `destroy()`. - Log cleanup failures instead of propagating them back through the UI action path. Test-Locally - Reproduced locally with OpenCode -> Codex switching causing IntelliJ to freeze. - Verified the same close-order patch locally stopped the freeze by letting the ACP process terminate before protocol cleanup.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…s such as OpenCode and Codex in the ProxyAI agent runtime selector.
Problem:
closeSession()was called synchronously from the runtime selector action path. Closing an active ACP session can block while closing stdio transport streams. In practice this can park the Swing UI thread inAcpProtocolCore.close()/StdioTransport.close(), leaving IntelliJ black-screened until the child ACPprocess is killed externally.
A freeze report captured the EDT stuck under:
AgentModelComboBoxAction.actionPerformedExternalAcpAgentService.closeSessionAcpProcessState.closeAcpProtocolCore.closeStdioTransport.closeFileDescriptor.close0Changes:
destroy().Test-Locally