Skip to content

Zed out of sync with changes made outside of editor #38109

@binarypie

Description

@binarypie

Summary

Adding, removing, or renaming files and folders outside of Zed will not automatically update the project panel.

Description

When working with complex projects where files will change outside of Zed the Zed editor falls out of sync with the system state. Specifically, open buffers and the project panel, and the git panel. Likely anything inside of Zed that relies on a cache of the current filesystem state.

Steps to reproduce:

  1. Start with a deep folder structure
  • Apps
    • app1
    • app2
    • app3
  • Packages
    • package 1
    • package 2
      • protos
        • service/v1/
      • src
    • package 3
  1. Have AI create some protos in package2/protos/service/v1
  2. Open some of these protos in Zed
  3. Download some actual protos that replace some of those files
  4. Download some actual protos that add new protos to that folder
  5. Open a terminal and cd into the directory to verify they are there
  6. Notice the open buffer did not update
  7. Notice the project file list did not update

Expected Behavior:

  • Open buffers should update when files are replaced on the system.
  • Project folder structure should be in sync when making changes outside of Zed
  • Git panel should always show the current state as if one typed git status in their terminal.

Actual Behavior:

  • Open buffers display the previous version of the file downloaded.
  • Git panel is completely ignorant of any changes even after doing git add .
  • Project panel still show the old state

Errors

LSP Failed to load workspaces. (click to expand)
2025-09-12T22:07:22-07:00 INFO  [project.lsp_format] Formatting via LSP
2025-09-12T22:07:22-07:00 ERROR [project::lsp_store] Formatting failed: failed to format via language server: Failed to spawn cd "/Code/packages/rust/services" && "rustfmt"
2025-09-12T22:07:22-07:00 ERROR [acp_thread] failed to format via language server

Caused by:
    Failed to spawn cd "/Code/packages/rust/services" && "rustfmt"
2025-09-12T22:07:37-07:00 INFO  [project.lsp_format] Formatting via LSP
2025-09-12T22:07:37-07:00 ERROR [project::lsp_store] Formatting failed: failed to format via language server: Failed to spawn cd "/Code/packages/rust/services/src/openfga" && "rustfmt"
2025-09-12T22:07:37-07:00 ERROR [acp_thread] failed to format via language server

Zed Version and System Specs

Zed: v0.202.8 (Zed)
OS: Linux Wayland bluefin 42
Memory: 125.6 GiB
Architecture: x86_64
GPU: AMD Radeon RX 7900 XTX (RADV NAVI31) || radv || Mesa 25.1.7

Activity

added theissue type on Sep 13, 2025
changed the title [-]Open buffers and project panel out of sync when changes are made outsdie of zed[/-] [+]Zed out of sync with changes made outside of editor[/+] on Sep 13, 2025
binarypie

binarypie commented on Sep 15, 2025

@binarypie
Author

An interesting note to this behavior. I'm not seeing the system fall out of sync when running in a container. So your typically devcontainer workflow works great.

That does basically disable the majority of the good AI tooling. So for now I'm running a combination of Auggie (Augment Code) and Gemini (Google) through their CLI.

Doesn't look as nice in the UI but we get the job done without issue.

If anyone from Zed reads this. The ability to just run any CLI out of the container as an agent would be awesome. There are so many tools out there and most of them have TUI. Would be nice to not have the editor open files on top of the agents when you split your main screen.

Image
psychedelicious

psychedelicious commented on Sep 16, 2025

@psychedelicious

This issue has started happening to me recently. I'm not sure when it started - maybe a week or two ago. The issue is intermittent with no clear pattern or repro.

Example scenarios:

  • I create a file via terminal, but the project panel does not show the new file until I reload the window.
  • An AI agent edits a file that is opened in a buffer, but the buffer doesn't update until I close it and reopen it.

If I recall correctly, once the issue starts happening, it doesn't stop until I reload the window. So maybe there is something going on w/ inotify or whatever watches the filesystem.

I use zed via remote dev. The remote host is Linux; the local client is macOS.

Zed: v0.204.1 (Zed Preview)
OS: macOS 14.3
Memory: 32 GiB
Architecture: aarch64

binarypie

binarypie commented on Sep 22, 2025

@binarypie
Author

Another update here. Developing inside a remote/container is having the same effect. None of my open buffers update when files are changes via the CLI. The project tree has also stopped updating.

psychedelicious

psychedelicious commented on Sep 22, 2025

@psychedelicious

I noticed something today that seems like it could be related. After switching branches, an open file synced correctly. I see the correct content in the buffer. But the LSP (basedpyright in this case) seems to be using the file contents from before switching branches.

Screen.Recording.2025-09-22.at.3.36.53.pm.mov

Note how there are warnings/errors in whitespace and for parts of symbols. The LSP messages are nonsensical for the rendered buffer contents.

After stopping all LSP servers, the warnings/errors are still present, as if there are orphaned LSP servers. I feel like this started happening intermittently at the same time as the stale buffers but I chalked it up to wonky LSP and reloaded zed to fix.

binarypie

binarypie commented on Sep 23, 2025

@binarypie
Author

I decided to take a look at my logs. The problem seems to happen when any LSP fails. So for example I do not have terraform installed but I do have tofu installed. However, if I open a TF file to change something then the whole editor loses lsp connection and refuses to work until refreshed.

Caused by: Terraform (CLI) is required. Please install Terraform or make it available in $PATH 2025-09-21T18:19:09-07:00 WARN [project::lsp_store] Get hover via terraform-ls failed: main.tf (224,3): unknown attribute "restart" 2025-09-21T18:19:09-07:00 ERROR [project] Get hover via terraform-ls failed: main.tf (224,3): unknown attribute "restart" 2025-09-21T18:19:10-07:00 WARN [project::lsp_store] Get definition via terraform-ls failed: no reference origin found 2025-09-21T18:19:10-07:00 ERROR [project] Get definition via terraform-ls failed: no reference origin found 2025-09-21T18:19:11-07:00 INFO [project.lsp_format] Formatting via LSP 2025-09-21T18:19:11-07:00 ERROR [project::lsp_store] Formatting failed: failed to format via language server: Terraform (CLI) is required. Please install Terraform or make it available in $PATH 2025-09-21T18:19:11-07:00 ERROR [editor] failed to format via language server

psychedelicious

psychedelicious commented on Sep 23, 2025

@psychedelicious

@binarypie How are you getting those logs?

I remembered another oddity that has been occurring for me in the same timeframe, that may support the issue being related to LSP failing.

Sometimes, I use Find All References on a symbol, but it doesn't work (nothing happens). After a few attempts it works, and I move on with my work.

A while later - many seconds to a couple minutes later - the Find All References results window for that symbol randomly open up, without me having used that LSP feature. It's as if the first failed Find All References was queued somewhere in the background and took a while to be executed.

binarypie

binarypie commented on Sep 23, 2025

@binarypie
Author

@psychedelicious you can run zed: open log from the execute command shortcut (ctrl+shift+p)

added
workspaceFeedback for workspace management, layout, interactions, etc
on Sep 24, 2025
xsoheilalizadeh

xsoheilalizadeh commented on Sep 24, 2025

@xsoheilalizadeh

I have this issue when AI agent from terminal edits the workspace, this is not limited to the file explorer also the git windows is out of sync, I have to restart zed every time.

binarypie

binarypie commented on Sep 24, 2025

@binarypie
Author

I have this issue when AI agent from terminal edits the workspace, this is not limited to the file explorer also the git windows is out of sync, I have to restart zed every time.

@xsoheilalizadeh next time this happens open the logs and if anything has crashed can you paste them here?

18 remaining items

binarypie

binarypie commented on Oct 29, 2025

@binarypie
Author

I just encountered the issue again. A file was created in a symlinked folder and it was not picked up (Linux). I do think this is related to symlinks.

I enabled the logging but don't see anything regarding the missing files.

I'm running Zed connected to a remote with no symlinks in the main folder and building rust applications. Main /src files will just not exist or stop being updated even when closing and opening the buffer.

ActuallyHappening

ActuallyHappening commented on Nov 1, 2025

@ActuallyHappening

Getting out of sync fs bugs all the time, reloading doesn't fix the issue

Akiyamka

Akiyamka commented on Nov 6, 2025

@Akiyamka

Nothing special needed for reproduce this. No crashing LSP, symlinks, monorepos etc.

Steps to reproduce:

  • Open empty project in zed
  • Open embedded terminal in zed
  • touch ./helloworld

Expected Behavior:

  • New file is visible in Project panel

Actual Behavior:

  • New file is not visible in Project panel
added a commit that references this issue on Nov 7, 2025
olejorgenb

olejorgenb commented on Nov 9, 2025

@olejorgenb
Contributor

Another duplicate I think: #15791

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

workspaceFeedback for workspace management, layout, interactions, etc

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

    Development

    No branches or pull requests

      Participants

      @binarypie@mgood@olejorgenb@SomeoneToIgnore@psychedelicious

      Issue actions

        Zed out of sync with changes made outside of editor · Issue #38109 · zed-industries/zed