zed-industries/zed · error

Project not found

Error message

Project not found

What it means

Emitted by MentionSet::contents when the stored WeakEntity<Project> can no longer be upgraded — the project entity backing the mention set was dropped before contents were collected. This is a lifecycle sentinel: mention content resolution needs the project to open buffers/files, and with the project gone there is nothing to resolve against. The fault is the stale project handle, not the mentions themselves.

Solutions

  1. Collect mention contents while the project is still open
  2. Recreate the mention set from a live project after reopening the workspace
Defensive patterns

Strategy: fallback

When it happens

Trigger: Thrown at crates/agent_ui/src/mention_set.rs:83 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/3fff8d0ae00ab96c. Report an issue: GitHub.

Appendix: source

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

}

impl MentionSet {
    pub fn new(project: WeakEntity<Project>, thread_store: Option<Entity<ThreadStore>>) -> Self {
        Self {
            project,
            thread_store,
            mentions: HashMap::default(),
            crease_entities: HashMap::default(),
        }
    }

    pub fn contents(
        &self,
        full_mention_content: bool,
        cx: &mut App,
    ) -> Task<Result<HashMap<CreaseId, (MentionUri, Mention)>>> {
        let Some(project) = self.project.upgrade() else {
            return Task::ready(Err(anyhow!("Project not found")));
        };
        let mentions = self.mentions.clone();
        cx.spawn(async move |cx| {
            let mut contents = HashMap::default();
            for (crease_id, (mention_uri, task)) in mentions {
                let content = if full_mention_content
                    && let MentionUri::Directory { abs_path } = &mention_uri
                {
                    cx.update(|cx| full_mention_for_directory(&project, abs_path, cx))
                        .await?
                } else {
                    task.await.map_err(|e| anyhow!("{e}"))?
                };

                contents.insert(crease_id, (mention_uri, content));
            }
            Ok(contents)
        })

View on GitHub (pinned to f4178619ac)