zed-industries/zed · error
teacher response is empty (run predict first)
Error message
teacher response is empty (run predict first)
What it means
Bailed by the repair step when predictions exist but `predictions[0].actual_output` is an empty string. The teacher response is the model completion the repair prompt is built from; empty means the prediction call finished without content — an empty completion was stored, a provider error was swallowed into an empty record, or output parsing stripped everything.
Source
Thrown at crates/edit_prediction_cli/src/repair.rs:308
run_parse_output(example).context("Failed to execute run_parse_output")?;
if example.prompt_inputs.is_none() {
anyhow::bail!("prompt_inputs missing (run context retrieval first)");
}
if example.predictions.is_empty() {
anyhow::bail!("no predictions available (run predict first)");
}
let teacher_prompt = example
.prompt
.as_ref()
.context("prompt missing (run format_prompt first)")?;
let teacher_response = &example.predictions[0].actual_output;
if teacher_response.is_empty() {
anyhow::bail!("teacher response is empty (run predict first)");
}
let step_progress = example_progress.start(Step::Repair);
let model = model_for_backend(args.backend);
let repair_message = build_repair_message(example).context("Failed to build repair message")?;
step_progress.set_substatus("generating");
let response = match args.backend {
BatchProvider::Anthropic => {
let client = if args.no_batch {
ANTHROPIC_CLIENT_PLAIN.get_or_init(|| {
AnthropicClient::plain().expect("Failed to create Anthropic client")
})
} else {
ANTHROPIC_CLIENT_BATCH.get_or_init(|| {
AnthropicClient::batch(&LLM_CACHE_DB)View on GitHub (pinned to f4178619ac)
Solutions
- Re-run predict for the affected examples so a non-empty teacher response is stored
- Inspect the stored prediction record for an accompanying provider error or unusual finish reason
- Add a predict-side check that rejects or retries empty completions instead of persisting them
Example fix
// before
let actual_output = response.text; // may be empty and still gets stored
// after
if response.text.is_empty() {
anyhow::bail!("provider returned an empty completion, not storing prediction");
}
let actual_output = response.text; Defensive patterns
Strategy: validation
Validate before calling
if let Some(first) = example.predictions.first() {
if first.actual_output.is_empty() {
// re-run predict for this example instead of repairing
}
} Try / catch
On this bail, re-queue the example through predict (optionally with a retry) rather than repairing — repair cannot proceed without teacher content.
Prevention
- Reject or retry empty completions in the predict stage before persisting
- Log provider finish reasons next to outputs to spot empty-content cases
- Add a batch-level check that flags examples with empty actual_output before repair runs
When it happens
Trigger: Running repair on examples where predict recorded a prediction entry with empty `actual_output`: provider returned an empty completion, the request failed but an empty record was persisted, or content filtering removed the output.
Common situations: Rate-limited or flaky provider runs storing empty outputs; models refusing and returning empty content; max-token truncation producing empty text.
Related errors
- prompt_inputs missing (run context retrieval first)
- prompt_inputs missing (run context retrieval first)
- no predictions available (run predict first)
- sweep prompt {field_name} contains reserved tokens
- --languages and/or --extensions is required (use --list to s
AI-assisted analysis of zed-industries/zed@f4178619ac (2026-08-20).
Data as JSON: /api/errors/09e7b6f853538683.
Report an issue: GitHub.