Cursor gangs permanetly showing waiting for cnnection during long agent sessions

Hey, thanks for another great report.

This is a known cluster of issues. Long agent sessions build up listener leaks and memory leaks in the extension host, and over SSH Remote it hits harder because the forked extension host scales with VSZ. The symptoms you described, Fetch.terminate in undici, [composer] No loaded composer found, a hang on “waiting for connection” with no recovery, are all part of the same degradation, not separate bugs. There’s a similar case with the same symptoms here: Remote extension host memory grows unboundedly over long agent chats; RPC reply handlers leak.

Your workaround, rotating conversations every about 45 minutes or about 75 messages, is the right mitigation for now. RSS around 950 MB without OOM matches what we see. The bottleneck is not heap exhaustion, it’s listener buildup that chokes the event loop.

We’re tracking the issue, but I can’t share an ETA for a fix yet. When something ships in a release, I’ll reply here.

A couple quick notes:

  • worker.js missing from cursor-agent-exec/dist/ during PDF reads is a separate issue. If you can reproduce it reliably, please open a separate thread and we’ll investigate.
  • A custom OpenAI-compatible proxy endpoint doesn’t really change the picture since the leak is on the client side. If you want to rule out proxy-side aborts as part of crash mode 1, try the same workflow in a session using a stock model and compare at what message count the hang starts.