zed icon indicating copy to clipboard operation
zed copied to clipboard

Agent: client error (SendRequest) connection error received fatal alert: BadRecordMac

Open didier opened this issue 7 months ago • 2 comments

Summary

Every couple of minutes, I get this error. I believe this happens for all providers, I tested Anthropic, Gemini, OpenAI.

Error interacting with language model
failed to send request to Anthropic
failed to send request to Anthropic
error sending request for url (https://api.anthropic.com/v1/messages)
client error (SendRequest)
connection error
received fatal alert: BadRecordMac

Description

Steps to reproduce:

  1. Just prompt to any AI model for a while
  2. At some point it errors out with the attached error.

Expected Behavior: Actual Behavior:

It should just keep working.

Zed Version and System Specs

Zed: v0.187.8 (Zed) OS: macOS 15.5.0 Memory: 32 GiB Architecture: aarch64

didier avatar May 26 '25 11:05 didier

Similar here. It's preventing me from using Agent Mode (which is annoying since I'm on the paid plan). Tried updating Zed + rebooting Mac to no luck.

Error interacting with language model
error sending request for url (https://llm.zed.dev/completions?)
client error (SendRequest)
connection error
received fatal alert: BadRecordMac

Zed: v0.188.4 (Zed) OS: macOS 15.0.1 Memory: 32 GiB Architecture: aarch64

caseymatt avatar May 30 '25 15:05 caseymatt

Chiming in some more: I get this error 30+ times a day. It's very frustrating, but because when it works, Zed's agent is really good.

didier avatar May 30 '25 18:05 didier

I think this is an anthropic SSL error, here are more details:

  • https://github.com/anthropics/claude-code/issues/969
  • https://github.com/anthropics/anthropic-quickstarts/issues/85

but maybe proxied by zed:

Error interacting with language model error sending request for url (https://llm.zed.dev/completions?) client error (SendRequest) connection error received fatal alert: BadRecordMac

edit: but it only happens to me with Claude Sonnet 4 from Zed. If I use it from GitHub it works. so it's just an SSL proxy error between ZED and Anthropic

JonathanSchndr avatar Jun 05 '25 13:06 JonathanSchndr

also getting this

comptergeeks avatar Jun 05 '25 20:06 comptergeeks

Still getting this multiple times a day.

didier avatar Jun 10 '25 11:06 didier

frustrating Error interacting with language model error sending request for url (https://llm.zed.dev/completions?) client error (SendRequest) connection error received fatal alert: BadRecordMac

FrankOrozcoGT avatar Jun 25 '25 14:06 FrankOrozcoGT

Same exact issue here

alexanderameye avatar Jul 22 '25 19:07 alexanderameye

Hey folks, this is still happening daily, and frankly is making Zed's AI features unusable.

didier avatar Aug 08 '25 11:08 didier

I'm sorry that folks are running into this but we're kind of blind as to how to troubleshoot as no one at Zed has yet reproduced this behavior.

The only time I have ever seen these sort of errors is when there network path corruption, either via problems with your ISP or local network equipment (e.g. routers with bad memory) or with your local network stack (security software failing at man-in-middling your traffic; issues with NIC drivers).

I know this may sound patronizing and a long shot, but can anyone who is consistently seeing this attempt to see if the issue is still reproducible if you change everything in your network path? E.g. instead of connecting via: laptop -> wifi/ethernet -> home router -> ISP -> Zed switch to tethering to your phone (with wifi off) so: laptop -> usb -> phone -> mobile ISP -> Zed to see if there's any improvement?

For example, I once solved seeing similar behavior by replacing Amazon USB3 Gigabit Ethernet adapter (RTL8153 based) with a 2.5GBE (RTL8156 based) one. Similarly years ago I had a cheap Belkin WiFi router which exhibited similar corrupting breaking TLS negotiations very infrequently (maybe once a day), I switched to a new router the problems went away and they returned when I temporarily switched back.

Separately, perhaps Zed should more gracefully recover from Network path corruption like this. Rather than just failing, it might be better for Zed to attempt retrying. I haven't yet dug into the error path, but if someone was so inclined, I'd be happy to review a PR which more gracefully handled such errors. Generally Zed does not attempt to recover to errors triggered from the TLS layer -- that's usually an indication that something is really messed up.

Sorry I don't have a better answer.

notpeter avatar Aug 19 '25 22:08 notpeter