zed-industries/zed · error

project not found

Error message

project not found

What it means

Emitted by confirm_mention_for_file when the mention set's WeakEntity<Project> cannot be upgraded — the project was dropped before the file mention was confirmed. Confirming a file mention requires the project to map the path and open the buffer, so with a stale project handle the operation is refused. The fault is the dropped project entity, not the file path.

Solutions

  1. Confirm file mentions while the project is still open
  2. Re-add the mention after reopening the workspace so it binds to a live project
Defensive patterns

Strategy: fallback

When it happens

Trigger: Thrown at crates/agent_ui/src/mention_set.rs:391 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of zed-industries/zed@f4178619ac (2026-08-20). Data as JSON: /api/errors/09f378c4dade0906. Report an issue: GitHub.

Appendix: source

Thrown at crates/agent_ui/src/mention_set.rs:391

                        // Remove mention
                        editor.edit([(start_anchor..end_anchor, "")], cx);
                    });
                    this.mentions.remove(&crease_id);
                    this.crease_entities.remove(&crease_id);
                })
                .ok();
            }
        })
    }

    pub fn confirm_mention_for_file(
        &self,
        abs_path: PathBuf,
        supports_images: bool,
        cx: &mut Context<Self>,
    ) -> Task<Result<Mention>> {
        let Some(project) = self.project.upgrade() else {
            return Task::ready(Err(anyhow!("project not found")));
        };

        let Some(project_path) = project
            .read(cx)
            .project_path_for_absolute_path(&abs_path, cx)
        else {
            return Task::ready(Err(anyhow!(
                "project path not found for file mention {abs_path:?}"
            )));
        };

        if is_raster_image_path(&abs_path) {
            if !supports_images {
                return Task::ready(Err(anyhow!("This model does not support images yet")));
            }
            let task = project.update(cx, |project, cx| project.open_image(project_path, cx));
            return cx.spawn(async move |_, cx| {
                let image = task.await?;

View on GitHub (pinned to f4178619ac)