zed-industries/zed · error
only one marker tag found in output, expected at least two
Error message
only one marker tag found in output, expected at least two
What it means
The model output contained exactly one marker tag, but a replacement span requires a start and an end tag. apply_marker_span_impl guards against this degenerate case before attempting boundary resolution.
Source
Thrown at crates/zeta_prompt/src/multi_region.rs:756
);
}
/// Parse byte-exact model output and reconstruct the full new editable region.
///
/// `resolve_boundary` maps a parsed tag value to an absolute byte offset in
/// old_editable, given the marker_offsets. Returns `(start_byte, end_byte)` or
/// an error.
fn apply_marker_span_impl(
old_editable: &str,
tags: &[ParsedTag],
output: &str,
resolve_boundaries: impl Fn(isize, isize) -> Result<(usize, usize)>,
) -> Result<String> {
if tags.is_empty() {
return Err(anyhow!("no marker tags found in output"));
}
if tags.len() == 1 {
return Err(anyhow!(
"only one marker tag found in output, expected at least two"
));
}
let start_value = tags[0].value;
let end_value = tags[tags.len() - 1].value;
if start_value == end_value {
return Ok(old_editable.to_string());
}
let (start_byte, end_byte) = resolve_boundaries(start_value, end_value)?;
if start_byte > end_byte {
return Err(anyhow!("start marker must come before end marker"));
}
let mut new_content = String::new();View on GitHub (pinned to f4178619ac)
Solutions
- Reject the output and re-request so the model emits both start and end markers
- Verify the output was not truncated mid-edit (e.g. by a token limit or end-marker stripping)
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at crates/zeta_prompt/src/multi_region.rs:756 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/db0b8a938937cadb.
Report an issue: GitHub.