{"record":{"id":"f82711c904f27821","repo":"zed-industries/zed","slug":"instruction-is-empty","errorCode":null,"errorMessage":"instruction is empty","messagePattern":"instruction is empty","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/eval_cli/src/main.rs","lineNumber":402,"sourceCode":"    SettingsStore::update_global(cx, |store, cx| {\n        store.set_user_settings(&settings, cx).result()\n    })\n    .context(\"applying anthropic available_models settings\")?;\n    Ok(())\n}\n\nfn read_instruction(args: &Args) -> Result<String> {\n    let mut text = if let Some(text) = &args.instruction {\n        text.clone()\n    } else {\n        use std::io::Read;\n        let mut buf = String::new();\n        std::io::stdin()\n            .read_to_string(&mut buf)\n            .context(\"reading instruction from stdin\")?;\n        buf\n    };\n    anyhow::ensure!(!text.trim().is_empty(), \"instruction is empty\");\n\n    if let Some(path) = &args.instruction_suffix_file {\n        let suffix = read_instruction_suffix_file(path)?;\n        text.push_str(\"\\n\\n\");\n        text.push_str(&suffix);\n    }\n    Ok(text)\n}\n\nfn read_instruction_suffix_file(path: &PathBuf) -> Result<String> {\n    let suffix = std::fs::read_to_string(path)\n        .with_context(|| format!(\"reading instruction suffix file {}\", path.display()))?;\n    let suffix = suffix.trim().to_string();\n    anyhow::ensure!(!suffix.is_empty(), \"instruction suffix file is empty\");\n    Ok(suffix)\n}\n\nasync fn wait_for_model(selected: &SelectedModel, cx: &mut AsyncApp) -> Result<()> {","sourceCodeStart":384,"sourceCodeEnd":420,"githubUrl":"https://github.com/zed-industries/zed/blob/f4178619acd0d47ea1f76a2025c42962c6d6638c/crates/eval_cli/src/main.rs#L384-L420","documentation":"read_instruction found that the final instruction text — from --instruction or stdin — is empty or only whitespace. The ensure! guard rejects blank instructions because an agent run with no prompt is meaningless; this is a CLI usage error, not an I/O failure (stdin read already succeeded).","triggerScenarios":"Thrown at crates/eval_cli/src/main.rs:402 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Provide a non-empty --instruction argument or pipe actual prompt text into stdin","Trim/check input before invoking eval_cli in scripts and fail early with a clearer message"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}