zed-industries/zed · error

prompt file not found: {name}

Error message

prompt file not found: {name}

What it means

prompt_assets embeds the `src/prompts` folder via rust-embed (`#[folder = "src/prompts"]`) and looks prompts up by exact name. A lookup returning None panics with 'prompt file not found: {name}'. In debug builds rust-embed reads the folder from disk at runtime; in release builds the files are baked in at compile time, so an old binary cannot see newly added prompt files.

Source

Thrown at crates/edit_prediction_cli/src/prompt_assets.rs:44

#[cfg(not(feature = "dynamic_prompts"))]
pub fn get_prompt(name: &'static str) -> Cow<'static, str> {
    use rust_embed::RustEmbed;

    #[derive(RustEmbed)]
    #[folder = "src/prompts"]
    struct EmbeddedPrompts;

    match EmbeddedPrompts::get(name) {
        Some(file) => match file.data {
            Cow::Borrowed(bytes) => {
                Cow::Borrowed(std::str::from_utf8(bytes).expect("prompt file is not valid UTF-8"))
            }
            Cow::Owned(bytes) => {
                Cow::Owned(String::from_utf8(bytes).expect("prompt file is not valid UTF-8"))
            }
        },
        None => panic!("prompt file not found: {name}"),
    }
}

View on GitHub (pinned to f4178619ac)

Solutions

  1. List crates/edit_prediction_cli/src/prompts/ and use the exact file name (including extension) in the lookup
  2. Rebuild the binary so newly added prompt files are embedded for release builds
  3. If a prompt was intentionally removed, update or remove the caller requesting it

Example fix

// before
PromptAsset::get("teacher_prompt.tx")  // typo -> panic

// after
PromptAsset::get("teacher_prompt.txt")
Defensive patterns

Strategy: validation

Validate before calling

// after adding a prompt file, rebuild before release runs
cargo build --release -p edit_prediction_cli

Prevention

When it happens

Trigger: Requesting a prompt name that is not present in crates/edit_prediction_cli/src/prompts — a typo, a renamed/deleted file, or a file added after the currently running release binary was compiled.

Common situations: Renaming a prompt file without updating callers; passing a constructed name (e.g. with a missing extension); running a stale release binary that predates a new prompt.

Related errors


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