Bug: Agent (Opus/Sonnet) gets "Connection Error" / stuck at "Reconnecting" in Remote SSH (while Ask works)

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

“I am using Remote SSH to connect to a GPU server. My local machine has a VPN proxy (TUN mode) enabled.
The ‘Ask’ and ‘Chat’ features work perfectly (meaning local network is fine).
However, the ‘Agent’ mode using Claude Opus/Sonnet 4.6 keeps showing ‘Connection Error (failed 10 times)’ or gets stuck at ‘Reconnecting…’.
I have already tried setting Http: Proxy Support to override and using SSH Reverse Tunneling (-R), but the Agent process on the remote host still cannot access the internet.”

Steps to Reproduce

Open Cursor on a local Windows machine.
Enable local VPN/Proxy (e.g., TUN mode).
Connect to a remote Linux server using “Remote SSH”.
Open “Agent” mode and send any prompt (using Claude 3.5 Sonnet or Opus).
The Agent process fails to connect to the internet, showing “Connection Error” or stuck at “Reconnecting…”, even though standard “Ask” and “Chat” features work perfectly.

Expected Behavior

The Agent should be able to connect to the internet and process prompts normally over Remote SSH, just like the standard “Chat” and “Ask” features do, either by utilizing the host network properly or respecting proxy settings.

Screenshots / Screen Recordings

Operating System

Windows 10/11

Version Information

cursor version:2.6.20
vscode version:1.105.1

Does this stop you from using Cursor

Yes - Cursor is unusable

Hey, thanks for the report. This is a known issue. Agent mode uses a different type of connection, streaming, compared to Ask/Chat, and it’s more sensitive to SSH tunnels and VPN or proxy setups.

A few things to try:

  1. Switch the bottom panel from Terminal to Output. Select Remote-SSH in the dropdown. Some users report that having the Terminal panel visible causes Agent to fail over SSH. Hiding it or switching to Output can unblock it.

  2. Disable HTTP/2: Settings Ctrl+, > search HTTP/2 > enable Disable HTTP/2. You may have already tried this, but it’s worth confirming.

  3. Try without TUN mode temporarily, since the VPN adds another layer that can interfere with long-lived streaming connections. If Agent works without TUN, that confirms the root cause.

  4. Start a fresh chat session. Sometimes the connection error gets stuck in a specific session.

Also, could you share:

  • Output from Settings > Network > Run Diagnostics
  • Any errors from Help > Toggle Developer Tools, console tab

Similar reports for reference:

The team is aware of this class of issues with Agent over SSH. Let me know how it goes with the workarounds above.

Hi Dean,
Thanks for the suggestions!

Unfortunately, I tried all 4 workarounds (switching to Output panel, disabling HTTP/2, turning off TUN mode, and starting a fresh chat), but the Agent is still stuck at “Connection Error”.

However, I ran the diagnostics and checked the Developer Tools as you requested, and the logs are very consistent. It seems Cursor is failing to connect to a local proxy at 127.0.0.1:7890.

Network Diagnostics:
```text
Cursor Network Diagnostic Results

FAILED (9): SSL, API, Ping, Chat, Agent, Marketplace, Authentication, Downloads, CDN

(All failed with the same error below)
API: Error: [internal] Failed to establish a socket connection to proxies: PROXY 127.0.0.1:7890
Chat: Error: [internal] Failed to establish a socket connection to proxies: PROXY 127.0.0.1:7890
Agent: Error: [internal] Failed to establish a socket connection to proxies: PROXY 127.0.0.1:7890
```

Developer Tools Console Errors:
I have attached screenshots of the console. The repeating error is:
ConnectError: [internal] Failed to establish a socket connection to proxies: PROXY 127.0.0.1:7890

Since I am using Remote-SSH, is it possible that the Agent/streaming process is trying to look for proxy port 7890 on the remote Linux server’s localhost, rather than my local Windows machine? Standard Chat used to work fine, but Agent fails.

Let me know what you think the best way to configure the proxy for SSH Agent mode is!