zed-industries/zed · error

Untitled buffer selection mentions are not supported for…

Error message

Untitled buffer selection mentions are not supported for paste

What it means

Raised by confirm_mention_for_uri when pasting a mention whose URI is a Selection with no abs_path — i.e. a selection in an untitled (unsaved) buffer. Converting a selection mention into pasteable content requires a real file to read from; untitled buffers have no path, so the guard rejects the paste. The offending input is the Selection mention with abs_path: None.

Solutions

  1. Save the untitled buffer to disk before copying its selection mention
  2. Copy the selected text directly instead of pasting it as a mention
Defensive patterns

Strategy: validation

When it happens

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

Appendix: source

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

                line_range,
                ..
            } => self.confirm_mention_for_symbol(abs_path, line_range, cx),
            MentionUri::Skill {
                skill_file_path, ..
            } => self.confirm_mention_for_skill(skill_file_path, cx),
            MentionUri::Diagnostics {
                include_errors,
                include_warnings,
            } => self.confirm_mention_for_diagnostics(include_errors, include_warnings, cx),
            MentionUri::GitDiff { base_ref } => {
                self.confirm_mention_for_git_diff(base_ref.into(), cx)
            }
            MentionUri::Selection {
                abs_path: Some(abs_path),
                line_range,
                ..
            } => self.confirm_mention_for_symbol(abs_path, line_range, cx),
            MentionUri::Selection { abs_path: None, .. } => Task::ready(Err(anyhow!(
                "Untitled buffer selection mentions are not supported for paste"
            ))),
            MentionUri::PastedImage { .. }
            | MentionUri::TerminalSelection { .. }
            | MentionUri::MergeConflict { .. }
            | MentionUri::Rule { .. } => {
                Task::ready(Err(anyhow!("Unsupported mention URI type for paste")))
            }
        }
    }

    pub fn remove_mention(&mut self, crease_id: &CreaseId, cx: &mut App) {
        self.mentions.remove(crease_id);
        self.crease_entities.remove(crease_id);
        self.recompute_disambiguation(cx);
    }

    pub fn creases(&self) -> HashSet<CreaseId> {

View on GitHub (pinned to f4178619ac)