Fix for chat "Reconnect" issue in devcontainers

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

After recent update, since yesterday, I was experiencing “Reconnecting” with any chat request from within my devcontainers and “Taking longer than expected” when messaging from Agents Window into a devcontainer.

Steps to Reproduce

Just any message in chat window in IDE or in Agents Window connected to a devcontainer.

Operating System

MacOS

Version Information

Version: 3.21.9
VS Code Extension API: 1.128.0
Commit: 9998796a6096ce83d83a9332bfe7473b985db750
Date: 2026-09-17T02:16:48.732Z
Layout: IDE
Build Type: Stable
Release Track: Default
Electron: 42.10.0
Chromium: 148.0.7778.280
Node.js: 24.18.1
V8: 14.8.178.38-electron.0
xterm.js: 6.1.0-beta.291
OS: Darwin arm64 25.6.0

For AI issues: which model did you use?

Any model

Additional Information

I actually found a fix, hope this will help someone as I see a lot of people posting about connection issues last few days.
I’ve added a whole bunch of Cursor hostnames into a Docker firewall config (add allowed-domains).

Since I’m a new user and cannot post more than 2 links, I won’t share a domain list.
But you can grab it via “Cursor Settings” → “Browser & Network” → “Required Domains” → “Copy domains”.
Just make sure you add all of the subdomains for api5 host (they can be found here: Network Configuration | Cursor Docs)

This was not needed in the previous versions of Cursor though.
Cheers!

Does this stop you from using Cursor

Yes - Cursor is unusable

Hey, thanks for the report and for sharing the fix. You diagnosed it correctly.

In recent versions, the Agent connection to Cursor servers is opened from inside the dev container, not from the Cursor app on your Mac. Because of that, a container firewall that only allows specific hostnames now also needs to allow Cursor domains. The in-container chat and the Agents Window that talks to that container use the same path, which explains why you see both symptoms.

For anyone who hits the same issue, you can get the domains in Cursor Settings > Browser & Network > Required Domains > Copy domains. Most container firewalls don’t understand wildcards, so you need to expand *.api5.cursor.sh into the explicit hosts from Network Configuration | Cursor Docs, plus api2.cursor.sh, and make sure DNS requests to those hosts are allowed too.

As for why it didn’t used to be required, yep, the behavior changed in recent releases. I passed this to the team as feedback. We’re looking into letting the Agent connect through the local Cursor app when the container can’t reach our servers directly, so firewall changes won’t be needed. I can’t share an ETA yet, but we’ll post updates.

Thanks again for writing up the solution. It will really help other users.

2 Likes

The issue has been fixed for me with version 3.21.13+.

"Agent Stability: Patches within the 3.21.x cycle (specifically following the initial 3.21.4 rollout) address intermittent network hanging issues where the agent would get stuck indefinitely on “Taking longer than expected” prompts. "

Hey, thanks for following up. Glad it started working after the update.

Quick clarification so we don’t confuse anyone. The stabilization patches in the 3.21.x cycle mentioned in the release notes fix a general hang on “Taking longer than expected”. That’s slightly different from the specific case in this thread. Here, the issue was the container firewall only allowing certain hostnames. In newer versions, Agent opens the connection from inside the dev container, so you need to add the Cursor domains to your firewall allowlist. For this scenario, the solution from Post #5 is still the right one. Allowlist the domains and expand *.api5.cursor.sh into explicit hosts.

We’re still working on an improvement where Agent can route through the local Cursor app when the container can’t reach our servers directly. That would avoid firewall changes. I can’t share an ETA yet, but we’ll post updates in this thread.

If you’re on 3.21.13+ and you still see this happening specifically inside the dev container, please reply and we’ll take a closer look.

Hey, coming back with an update like I promised.

The improvement I mentioned above is now available. Starting in Cursor 3.21.13, if Agent can’t reach our servers from inside a dev container, it will automatically route that connection through the Cursor app on your Mac. That means the container firewall no longer needs to keep Cursor domains on an allowlist for chat and the Agents Window to work.

Your current allowlist setup will keep working as-is, so you don’t need to change anything. If you want to remove those firewall entries, just make sure you’re on a recent version, stable is currently 3.21.18. If you want to skip the automatic check entirely, you can set cursorAgentHost.remoteInferenceRoute to always in settings. It applies after you reload the window.

Let me know if you’re still seeing “Reconnecting” inside the dev container on the latest version and we’ll dig in.

cc @MeLeesa

1 Like