zed icon indicating copy to clipboard operation
zed copied to clipboard

Agent Panel: Delay between submit and UI update

Open nathanael-ruf opened this issue 8 months ago • 9 comments

Summary

Significant delay between submitting a prompt and it appearing in the chat ui.

Description

Steps to trigger the problem:

  1. Use Gemini 2.5 (not sure if this is required)
  2. Submit a prompt
  3. Wait

Actual Behavior: See recording:

https://github.com/user-attachments/assets/6e02ba03-d4e5-4a70-9462-24f5ef583bb1

Expected Behavior: Immediate UI feedback

I really like Zed and have been using it for over 2 years as my main IDE, but unfortunately I'm not a fan of the new assistant panel. Here is some of my feedback. If I should rather provide this somewhere else, let me know:

  • Where are the tabs that we used to have for different chats?
  • I really liked that I could just select and delete AI responses or even my own prompts from the chat and "try again". If I noticed that my prompt lead the AI in the wrong direction it was easy to correct.
  • If there was a random error on submit I could try again by command clicking. Not possible anymore.
  • Where are the / commands (e.g. /file?) Was much quicker than clicking though the UI. Nvm. found it with @.

Zed Version and System Specs

Zed: v0.182.0 (Zed Preview) OS: macOS 15.3.1 Memory: 16 GiB Architecture: aarch64

nathanael-ruf avatar Apr 10 '25 08:04 nathanael-ruf

Hey! I can't reproduce this on the latest Preview version. For the sake of debugging, can you just verify whether this also happens while using other models instead of Gemini? I feel like this is not a model-related problem, but just want to double-check for now.

danilo-leal avatar Apr 18 '25 20:04 danilo-leal

Hey! I can still repro on

Zed: v0.183.8 (Zed Preview) 
OS: macOS 15.3.1
Memory: 16 GiB
Architecture: aarch64

with different models, including Sonnet 3.7.

nathanael-ruf avatar Apr 22 '25 07:04 nathanael-ruf

Same issue on my MacBook M3 Max, all interactions with the AI are really slow. When sending the prompt nothing happens (as in the prompted text disappears but then just nothing) and about 15 - 20 seconds later, the prompt appears in the chat box and the agent shows "Thinking".

Zed: v0.186.11
Os: macOS 15.4.1
Memory: 48GB
Architecture: aarch64

raits avatar May 20 '25 08:05 raits

I have this issue as well using Sonnet 4 via both Github Copilot and Zed model providers. I also had this issue during the AI early access.

Zed: 0.188.2 (Zed Preview: 02746250304a7563ae775d76714975adb8c5fd10)
Os: macOS 14.7.1
Memory: 64GB
Architecture: aarch64

I'm willing to build Zed and/or collect logs if that would help.

smpanaro avatar May 24 '25 17:05 smpanaro

I'm having the same issue on prior versions and now also on 0.188.3

Seems to be with one particular workspace.

Does not matter which AI model I select

Other workspaces on different repos/folders seem to respond instantly

I've tried re-applying all my API keys, reinstalling Zed (and wiping old app state/cache folders) but still the same problem.

Zed: 0.188.3 (774878816aa594a187c1f0d5471f0bd8e6a07427)
Os: macOS 15.5
Memory: 64GB
Architecture: arm64

dpgarrick avatar May 29 '25 01:05 dpgarrick

Can anyone confirm whether there is anything your Zed.log when this happens?

Since there are multiple folks impacted by this, but yet the vast majority of users are not seeing this, my assumption is that there is something distinct on y'all machines or network configurations which are contributing to this issue.

  1. Can other folks which providers/models they are using?
  2. Does this also happen with text threads or only on the agent panel?
  3. Do you have any MCP servers installed?
  4. Does it impact all profiles (ask / write, etc)
  5. Does it change if you are connected via a different network isp (e.g. via phone tethering) Are any of you running endpoint security products on you Mac (AVG, Avast, Mcaffe, etc) or corporate VPN products (Cisco AnyConnect) or other things which may sit in the traffic path?

Would anyone be willing to do a wireshark capture to observe the network portion of this?


@dpgarrick: Seems to be with one particular workspace.

Are other folks seeing this same behavior? Does it still happen on an empty workspace?

notpeter avatar May 29 '25 14:05 notpeter

  1. Same as before (Zed+Copilot, Sonnet 4).
  2. Text threads in the same project are fast. (I don't use text threads much anymore, so possible I just haven't hit it here yet.)
  3. No MCP.
  4. This is hard to track down, it seems a bit intermittent. (Sometimes the same agent thread is slow and fast.)
  5. No endpoint security products, I'm on fast home wifi. (Same Wifi as my macOS 15 computer, where I have never had the issue, working in larger codebases than the ones I am experiencing slowness on.)

The only thing I see in the Zed.log around this time is:

2025-05-29T10:58:18-04:00 ERROR [zeta] edit prediction failed

Caused by:
    error predicting edits.
    Status: 500
    Body: Model produced invalid output

On both an empty project and a different project, I don't experience the lag.

I would be willing to capture a WireShark trace, do you have specific instructions / an email I can send it to?

smpanaro avatar May 29 '25 17:05 smpanaro

@smpanaro Given that your issue is project specific, I think this is unlikely to be network related as I had initially assumed.

Are there potentially a bunch of dirty/uncommitted files in your worktree?

notpeter avatar May 29 '25 18:05 notpeter

Yes, a lot 😬. It says "1346 Changes" at the top.

smpanaro avatar May 29 '25 18:05 smpanaro

I also was facing this issue. But it only started recently. Then I realized that I unzipped a huge folder with lots of files in it in the same project dir. Suspected that it might be the cause, and deleted that folder and now the the delay is gone.

kjrjay avatar Jul 08 '25 04:07 kjrjay

100% reproducible for me in a project with lots of unstaged changes.

That seems to be the cause.

dpgarrick avatar Jul 21 '25 03:07 dpgarrick