[Bug] Loading long chats through ACP freezes the server. Apparently session.go gets stuck
cc-connect Version
1.5.0 and 1.5.1-beta3
Operating System
Windows (WSL)
Agent Type
Other
Platform
Telegram
Installation Method
npm (npm install -g cc-connect)
Bug Description
Here's the debugging result done by GPT 6 Astra. It also fixed it and I tested this after a local build:
I checked source matching your installed v1.5.1-beta.3, commit e27354b2. It contains this circular wait:
cc-connect creates a 128-event channel. It waits for session/load to finish before returning the session to the engine. Devin replays the old conversation during loading. The RPC reader synchronously pushes replay events into that channel. Once it fills, the reader blocks—so it cannot read the session/load response. The engine cannot consume the events because session creation hasn’t returned. Additionally, startup holds the engine-wide interactiveMu mutex throughout that wait. This lets one large session block other session operations.
Sources: ACP session construction and event delivery, synchronous RPC dispatch, engine startup locking.
What I verified live cc-connect PID 8240 and Devin PID 21420 remain alive. Neither used CPU during a short sample. Devin’s log stops during session loading. Console text selection is not active, ruling out a QuickEdit selection pause. The local API returned 404 immediately for an unknown route. GET /sessions timed out; its handler acquires the same session mutex
Recommended next step The main fix belongs in cc-connect: handle history replay without blocking the RPC reader, add a bounded startup timeout, and avoid holding the engine-wide mutex across the handshake. Increasing the buffer alone only postpones the failure.
FIX
Created a local cc-connect fork, pinned to your installed v1.5.1-beta.3 source, on branch fix/acp-session-load-replay. No commit or push was made.
The fix prevents session/update history replay from filling the ACP event buffer while session/load is waiting for its response. It still applies mode updates and logs a summary count and byte total without logging each replay payload. /cc-connect/agent/acp/session.go:219-227b /cc-connect/agent/acp/session.go:382-423
Added a regression test that sends 129 replay updates—one more than the buffer capacity—checks that loading completes and mode state is retained, and confirms that live updates still pass through. It failed against the original code and passed with the fix. /cc-connect/agent/acp/session_mode_test.go:507-520
Steps to Reproduce
Create a session through devin acp and keep chatting with the bot. Disconnect and reconnect, select the the same session. When the server will try to load a long conversation it will not finish and also will become unresponsive to any further commands.
Expected Behavior
The server shouldn't freeze
Actual Behavior
After trying to load the session through ACP the server freezes and becomes unresponsive to any further commands
Configuration (config.toml)
Logs / Error Output
Logs don't show anything unusual. It's a freeze not seen by any error handingAdditional Context
No response
Source: chenhg5/cc-connect