{"record":{"id":"2c86d47f0ecf70a5","repo":"zed-industries/zed","slug":"prompt-file-not-found-name","errorCode":null,"errorMessage":"prompt file not found: {name}","messagePattern":"prompt file not found: (.+?)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/edit_prediction_cli/src/prompt_assets.rs","lineNumber":44,"sourceCode":"\n#[cfg(not(feature = \"dynamic_prompts\"))]\npub fn get_prompt(name: &'static str) -> Cow<'static, str> {\n    use rust_embed::RustEmbed;\n\n    #[derive(RustEmbed)]\n    #[folder = \"src/prompts\"]\n    struct EmbeddedPrompts;\n\n    match EmbeddedPrompts::get(name) {\n        Some(file) => match file.data {\n            Cow::Borrowed(bytes) => {\n                Cow::Borrowed(std::str::from_utf8(bytes).expect(\"prompt file is not valid UTF-8\"))\n            }\n            Cow::Owned(bytes) => {\n                Cow::Owned(String::from_utf8(bytes).expect(\"prompt file is not valid UTF-8\"))\n            }\n        },\n        None => panic!(\"prompt file not found: {name}\"),\n    }\n}\n","sourceCodeStart":26,"sourceCodeEnd":47,"githubUrl":"https://github.com/zed-industries/zed/blob/f4178619acd0d47ea1f76a2025c42962c6d6638c/crates/edit_prediction_cli/src/prompt_assets.rs#L26-L47","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["List crates/edit_prediction_cli/src/prompts/ and use the exact file name (including extension) in the lookup","Rebuild the binary so newly added prompt files are embedded for release builds","If a prompt was intentionally removed, update or remove the caller requesting it"],"exampleFix":"// before\nPromptAsset::get(\"teacher_prompt.tx\")  // typo -> panic\n\n// after\nPromptAsset::get(\"teacher_prompt.txt\")","handlingStrategy":"validation","validationCode":"// after adding a prompt file, rebuild before release runs\ncargo build --release -p edit_prediction_cli","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep prompt file names as constants next to their callers so renames stay in sync","Rebuild release binaries after adding or renaming anything under src/prompts","Add a startup check that each expected prompt name resolves via EmbeddedPrompts::get"],"tags":["edit-prediction-cli","rust-embed","prompt-assets","panic"],"backgroundTag":"embedded-resource-not-found","analyzedSha":"f4178619acd0d47ea1f76a2025c42962c6d6638c","analyzedAt":"2026-08-20T19:29:52.058Z","contentChangedAt":"2026-08-20T19:29:52.058Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}