Cursor cli --connection lost, reconnecting

Where does the bug appear (feature/product)?

Cursor CLI

Describe the Bug

when i send a prompt, even a simple hello, if “network”: {
“useHttp1ForAgent”: false
}, tell me connection lost, trying to reconnect, while if it’s true it goes in loop generating, i have trying switching from home network to smartphone network but nothing changed, agent --print works for example

Steps to Reproduce

Open cursor cli and write everything

Expected Behavior

run code

Operating System

Windows 10/11

Version Information

Version: 2.5.20 (user setup)
VSCode Version: 1.105.1
Commit: 511523af765daeb1fa69500ab0df5b6524424610
Date: 2026-02-19T20:41:31.942Z
Build Type: Stable
Release Track: Default
Electron: 39.4.0
Chromium: 142.0.7444.265
Node.js: 22.22.0
V8: 14.2.231.22-electron.0
OS: Windows_NT x64 10.0.26200

For AI issues: which model did you use?

Auto

Additional Information

from agent --debug

2026-03-05T12:08:57.320
otel.error {“stack”:“OTLPExporterError: Bad Request\n at IncomingMessage. (C:\Users\offic\AppData\Local\cursor-agent\versions\2026.02.27-e7d2ef6\240.index.js:2:314964)\n at IncomingMessage.emit (node:events:519:35)\n at IncomingMessage.emit (node:domain:489:12)\n at endReadableNT (node:internal/streams/readable:1701:12)\n at process.processTicksAndRejections (node:internal/process/task_queues:90:21)”,“message”:“Bad Request”,“code”:“400”,“name”:“OTLPExporterError”,“data”:“{"error":"Trace spans collection is disabled for NO_STORAGE privacy mode"}”}
2026-03-05T12:09:10.452
logger {“message”:“[nal_agent_retries] Retrying attempt 4”,“metadata”:{“attempt”:4,“actionCase”:“userMessageAction”}}
2026-03-05T12:09:10.585
logger {“message”:“[NAL client stall detector] Stream activity resumed after stall”,“metadata”:{“reqId”:“e2ab4278-c041-41f6-aaee-bd5babe23183”,“stall”:{“duration_ms”:132,“model_name”:“Claude 4.5 Opus (Thinking)”,“disposed_ago_ms”:0,“last_outbound_message_type”:“runRequest”,“activities”:“[disposed] (MOST RECENT)\ndisposed\n[outbound_write]\nrunRequest”}}}
2026-03-05T12:09:10.586
logger {“message”:“[AGENT_ERROR_DIAGNOSTICS] requestId=e2ab4278-c041-41f6-aaee-bd5babe23183 decision=RETRY (countAsServerError=false, countAsTransportError=true)”,“metadata”:{“decision”:“RETRY (countAsServerError=false, countAsTransportError=true)”,“willRetry”:true,“enableAgentRetries”:true,“endlessRetries”:false,“isRunningInTest”:false,“stallAborted”:false,“serverErrorRetries”:0,“transportErrorRetries”:4,“attempt”:4}}
2026-03-05T12:09:10.586
logger {“message”:“Stream ended without turnEnded — connection likely dropped mid-stream (retry disabled by gate)”}
2026-03-05T12:09:10.586
unhandledRejection: [internal] Stream closed with error code NGHTTP2_ENHANCE_YOUR_CALM {“stack”:“ConnectError: [internal] Stream closed with error code NGHTTP2_ENHANCE_YOUR_CALM\n at i.from (C:\Users\offic\AppData\Local\cursor-agent\versions\2026.02.27-e7d2ef6\index.js:2:72466)\n at d (C:\Users\offic\AppData\Local\cursor-agent\versions\2026.02.27-e7d2ef6\index.js:2:45918)\n at Promise.reject (C:\Users\offic\AppData\Local\cursor-agent\versions\2026.02.27-e7d2ef6\index.js:2:57830)\n at ClientHttp2Stream. (C:\Users\offic\AppData\Local\cursor-agent\versions\2026.02.27-e7d2ef6\index.js:2:55364)\n at ClientHttp2Stream.emit (node:events:507:28)\n at ClientHttp2Stream.emit (node:domain:489:12)\n at emitErrorNT (node:internal/streams/destroy:170:8)\n at emitErrorCloseNT (node:internal/streams/destroy:129:3)\n at process.processTicksAndRejections (node:internal/process/task_queues:90:21)”,“error”:{“name”:“ConnectError”,“rawMessage”:“Stream closed with error code NGHTTP2_ENHANCE_YOUR_CALM”,“code”:13,“metadata”:{},“details”:,“cause”:{“code”:“ERR_HTTP2_STREAM_ERROR”}}}

Does this stop you from using Cursor

Yes - Cursor is unusable

Hey, this is a known HTTP/2 issue in the CLI. The NGHTTP2_ENHANCE_YOUR_CALM error points to exactly that.

Workaround is to switch the CLI to HTTP/1. From your post, it looks like you already tried useHttp1ForAgent: true, but you said it “goes in a loop generating”. Can you clarify what exactly happens?

  • Does the CLI keep showing retry errors over and over, like with HTTP/2?
  • Or does it say it is “generating” but the response never comes back?
  • Or something else?

Also please check a couple of things:

  1. Make sure the config is in the right file, .cursor/cli_config.json in your home directory (C:\Users\offic\.cursor\cli_config.json):

    {
      "network": {
        "useHttp1ForAgent": true
      }
    }
    
  2. Restart the CLI after changing the config.

  3. Try running agent --debug with HTTP/1 and share the log. We can check if the error changes.

Another user with the same issue fixed it this way: Cursor Agent can't connect backend - #3 by MJ_Kim

If HTTP/1 still does not help, please share the debug log for that case too, and confirm if you are using a VPN, proxy, or antivirus.

hi, when i put “useHttp1ForAgent” to true, keeps saying generating… without doing anything , the debug

i am not using a vpn,nor a proxy nor an antivirus

log is this:

2026-03-05T14:26:06.709

unhandledRejection: [invalid_argument] Error {“stack”:“ConnectError: [invalid_argument] Error\n at ie (C:\\Users\\Federico\\AppData\\Local\\cursor-agent\\versions\\2026.02.27-e7d2ef6\\index.js:2:60982)\n at C:\\Users\\Federico\\AppData\\Local\\cursor-agent\\versions\\2026.02.27-e7d2ef6\\index.js:2:68042\n at next (C:\\Users\\Federico\\AppData\\Local\\cursor-agent\\versions\\2026.02.27-e7d2ef6\\index.js:2:68052)\n at process.processTicksAndRejections (node:internal/process/task_queues:105:5)”,“error”:{“name”:“ConnectError”,“rawMessage”:“Error”,“code”:3,“metadata”:{},“details”:[{“type”:“aiserver.v1.ErrorDetails”,“value”:{“0”:8,“1”:36,“2”:18,“3”:67,“4”:10,“5”:11,“6”:66,“7”:97,“8”:100,“9”:32,“10”:82,“11”:101,“12”:113,“13”:117,“14”:101,“15”:115,“16”:116,“17”:18,“18”:50,“19”:65,“20”:112,“21”:112,“22”:101,“23”:110,“24”:100,“25”:32,“26”:100,“27”:97,“28”:116,“29”:97,“30”:32,“31”:101,“32”:120,“33”:99,“34”:101,“35”:101,“36”:100,“37”:115,“38”:32,“39”:109,“40”:97,“41”:120,“42”:105,“43”:109,“44”:117,“45”:109,“46”:32,“47”:115,“48”:105,“49”:122,“50”:101,“51”:32,“52”:111,“53”:102,“54”:32,“55”:53,“56”:50,“57”:52,“58”:50,“59”:56,“60”:56,“61”:48,“62”:48,“63”:32,“64”:98,“65”:121,“66”:116,“67”:101,“68”:115,“69”:32,“70”:0,“71”:24,“72”:1},“debug”:{“error”:“ERROR_BAD_REQUEST”,“details”:{“title”:“Bad Request”,“detail”:“Append data exceeds maximum size of 52428800 bytes”,“isRetryable”:false},“isExpected”:true}}]}}

2026-03-05T14:26:06.710

ephemeral.push [“Error: Bad Request”,“Append data exceeds maximum size of 52428800 bytes”]

2026-03-05T14:26:06.710

ErrorDetails displayed {“error”:36,“title”:“Bad Request”,“detail”:“Append data exceeds maximum size of 52428800 bytes”,“additionalInfo”:{}}

2026-03-05T14:26:06.711

analytics.track {“eventName”:“cli.error”,“props”:{“error_type”:“BAD_REQUEST”}}

2026-03-05T14:26:07.486

otel.error {“stack”:“OTLPExporterError: Bad Request\n at IncomingMessage. (C:\\Users\\Federico\\AppData\\Local\\cursor-agent\\versions\\2026.02.27-e7d2ef6\\240.index.js:2:314964)\n at IncomingMessage.emit (node:events:519:35)\n at IncomingMessage.emit (node:domain:489:12)\n at endReadableNT (node:internal/streams/readable:1701:12)\n at process.processTicksAndRejections (node:internal/process/task_queues:90:21)”,“message”:“Bad Request”,“code”:“400”,“name”:“OTLPExporterError”,“data”:“{\“error\”:\“Trace spans collection is disabled for NO_STORAGE privacy mode\”}”}

Thanks for the debug log, that helps clarify what’s going on.

With HTTP/1 enabled, the CLI runs into a different error: Append data exceeds maximum size of 52428800 bytes. This is a known bug where the request body gets inflated in HTTP/1 mode. The team is aware.

A couple things you can try:

  1. Run it from a smaller folder. Try running the CLI from an almost empty directory (for example, mkdir test && cd test && cursor-agent) just to confirm it works at all. Payload inflation is worse when the project context is large.

  2. Update the CLI. You’re on version 2026.02.27-e7d2ef6. Run cursor-agent update or reinstall to make sure you’re on the latest version.

If even a simple “hello” from an empty folder with HTTP/1 still hits the 50 MB limit, let me know. That will help narrow it down.

hi, following your instruct even on a empty folder, still goes on error:

otel.error {“stack”:“OTLPExporterError: Bad Request\n at IncomingMessage. (C:\\Users\\Federico\\AppData\\Local\\cursor-agent\\versions\\2026.02.27-e7d2ef6\\240.index.js:2:314964)\n at IncomingMessage.emit (node:events:519:35)\n at IncomingMessage.emit (node:domain:489:12)\n at endReadableNT (node:internal/streams/readable:1701:12)\n at process.processTicksAndRejections (node:internal/process/task_queues:90:21)”,“message”:“Bad Request”,“code”:“400”,“name”:“OTLPExporterError”,“data”:“{\“error\”:\“Trace spans collection is disabled for NO_STORAGE privacy mode\”}”}

2026-03-09T14:46:56.901

analytics.track {“eventName”:“cli.request.create”,“props”:{“length”:2,“model”:“composer-1.5”}}

2026-03-09T14:46:56.903

structured-log.info {“key”:“agent_cli”,“message”:“agent_cli.turn.start”,“metadata”:{“turn_type”:“new”,“bring_your_own_key”:“false”,“request_id”:“ccae42df-eaa0-4ba3-ba20-63486d833644”,“trace_id”:“f22d895beae0c5df44e7aeb825b21517”,“span_id”:“a8e8e865f736a1a1”}}

2026-03-09T14:46:59.737

structured-log.flush.success {“count”:1}

2026-03-09T14:47:00.544

logger {“message”:“[nal_agent_retries] Initial request”,“metadata”:{“attempt”:0,“actionCase”:“userMessageAction”}}

2026-03-09T14:47:00.718

privacy.refresh.start {“isStale”:false,“sampleEvery”:10}

2026-03-09T14:47:01.470

protoPrivacyToGhostMode {“privacyMode”:1}

2026-03-09T14:47:01.474

privacy.refresh.updated {“ghost”:true}

2026-03-09T14:47:02.535

otel.error {“stack”:“OTLPExporterError: Bad Request\n at IncomingMessage. (C:\\Users\\Federico\\AppData\\Local\\cursor-agent\\versions\\2026.02.27-e7d2ef6\\240.index.js:2:314964)\n at IncomingMessage.emit (node:events:519:35)\n at IncomingMessage.emit (node:domain:489:12)\n at endReadableNT (node:internal/streams/readable:1701:12)\n at process.processTicksAndRejections (node:internal/process/task_queues:90:21)”,“message”:“Bad Request”,“code”:“400”,“name”:“OTLPExporterError”,“data”:“{\“error\”:\“Trace spans collection is disabled for NO_STORAGE privacy mode\”}”}

any solution? @deanrie i can’t use cursor from a long time

Hey, sorry for the delay.

I can see that it still breaks even from an empty folder with HTTP/1. That’s a bug on our side. HTTP/1 mode increases the request size, and the server rejects it due to the 50 MB limit. The team is aware of the issue.

Quick question, did you update the CLI? You’re on version 2026.02.27-e7d2ef6. Please try:

agent update

If it says “Already up to date”, try reinstalling:

curl https://cursor.com/install -fsSL | bash

After updating, check agent --version and try again with useHttp1ForAgent: true from an empty folder.

If it’s still the same after updating, let me know and I’ll flag it to the team as a priority.

same issue on ubuntu with 2026.03.11-6dfa30c version

After updating the error persist

edit

i even tried to run it on a empty folder but it didn’t worked, the version is v2026.03.18-f6873f7