zed-industries/zed · error

instruction suffix file is empty

Error message

instruction suffix file is empty

What it means

The file given via --instruction-suffix-file was read successfully but its contents are empty/whitespace-only, so appending it would add nothing. An ensure! guard (analogous to the main instruction check) rejects the empty suffix file as a usage error.

Source

Thrown at crates/eval_cli/src/main.rs:416

            .read_to_string(&mut buf)
            .context("reading instruction from stdin")?;
        buf
    };
    anyhow::ensure!(!text.trim().is_empty(), "instruction is empty");

    if let Some(path) = &args.instruction_suffix_file {
        let suffix = read_instruction_suffix_file(path)?;
        text.push_str("\n\n");
        text.push_str(&suffix);
    }
    Ok(text)
}

fn read_instruction_suffix_file(path: &PathBuf) -> Result<String> {
    let suffix = std::fs::read_to_string(path)
        .with_context(|| format!("reading instruction suffix file {}", path.display()))?;
    let suffix = suffix.trim().to_string();
    anyhow::ensure!(!suffix.is_empty(), "instruction suffix file is empty");
    Ok(suffix)
}

async fn wait_for_model(selected: &SelectedModel, cx: &mut AsyncApp) -> Result<()> {
    let started_at = Instant::now();

    loop {
        let found = cx.update(|cx| find_available_model(selected, cx).is_some());
        if found {
            return Ok(());
        }

        cx.update(|cx| ensure_provider_authenticated(selected, cx))?;

        let selected_provider_has_models = cx.update(|cx| {
            LanguageModelRegistry::global(cx)
                .read(cx)
                .available_models(cx)

View on GitHub (pinned to f4178619ac)

Solutions

  1. Put the intended suffix content (few-shot examples, extra constraints) into the file
  2. Omit --instruction-suffix-file entirely if no suffix is needed
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at crates/eval_cli/src/main.rs:416 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/6ce53a6c77d37719. Report an issue: GitHub.