zed-industries/zed · error
Inline assistant response ended without completing `{REWRITE
Error message
Inline assistant response ended without completing `{REWRITE_SECTION_TOOL_NAME}` or `{FAILURE_MESSAGE_TOOL_NAME}` What it means
The completion event stream ended (next() returned None) without the model having emitted a completed rewrite_section or failure_message tool call, so the inline assist cannot produce an edit and errors.
Source
Thrown at crates/agent_ui/src/buffer_codegen.rs:1250
};
Ok(Some(ToolUseOutput::Failure {
message: std::mem::take(&mut input.message),
is_input_complete: tool_use.is_input_complete,
}))
}
_ => Ok(None),
}
};
let mut message_id = None;
let mut failure_started = false;
let mut failure_complete = false;
let last_token_usage = Arc::new(Mutex::new(TokenUsage::default()));
let first_text = loop {
let Some(event) = completion_events.next().await else {
if failure_complete {
finish_with_status(CodegenStatus::Done, cx);
} else {
finish_with_status(
CodegenStatus::Error(anyhow!(
"Inline assistant response ended without completing \
`{REWRITE_SECTION_TOOL_NAME}` or `{FAILURE_MESSAGE_TOOL_NAME}`"
)),
cx,
);
}
return;
};
match event {
Ok(LanguageModelCompletionEvent::StartMessage { message_id: id }) => {
message_id = Some(id);
}
Ok(LanguageModelCompletionEvent::ToolUse(tool_use)) => {
let output = match process_tool_use(tool_use) {View on GitHub (pinned to 5a9b9558db)
Solutions
- Retry the inline assist: transient stream truncation often resolves itself
- If it recurs, use a shorter target selection to reduce response length
- Check the model provider status for dropped streaming connections
Defensive patterns
Strategy: retry
When it happens
Trigger: Thrown at crates/agent_ui/src/buffer_codegen.rs:1248 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of zed-industries/zed@5a9b9558db (2026-08-20).
Data as JSON: /api/errors/d6544f3e65f44a42.
Report an issue: GitHub.