{"record":{"id":"db0b8a938937cadb","repo":"zed-industries/zed","slug":"only-one-marker-tag-found-in-output-expected-at-l","errorCode":null,"errorMessage":"only one marker tag found in output, expected at least two","messagePattern":"only one marker tag found in output, expected at least two","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/zeta_prompt/src/multi_region.rs","lineNumber":756,"sourceCode":"    );\n}\n\n/// Parse byte-exact model output and reconstruct the full new editable region.\n///\n/// `resolve_boundary` maps a parsed tag value to an absolute byte offset in\n/// old_editable, given the marker_offsets. Returns `(start_byte, end_byte)` or\n/// an error.\nfn apply_marker_span_impl(\n    old_editable: &str,\n    tags: &[ParsedTag],\n    output: &str,\n    resolve_boundaries: impl Fn(isize, isize) -> Result<(usize, usize)>,\n) -> Result<String> {\n    if tags.is_empty() {\n        return Err(anyhow!(\"no marker tags found in output\"));\n    }\n    if tags.len() == 1 {\n        return Err(anyhow!(\n            \"only one marker tag found in output, expected at least two\"\n        ));\n    }\n\n    let start_value = tags[0].value;\n    let end_value = tags[tags.len() - 1].value;\n\n    if start_value == end_value {\n        return Ok(old_editable.to_string());\n    }\n\n    let (start_byte, end_byte) = resolve_boundaries(start_value, end_value)?;\n\n    if start_byte > end_byte {\n        return Err(anyhow!(\"start marker must come before end marker\"));\n    }\n\n    let mut new_content = String::new();","sourceCodeStart":738,"sourceCodeEnd":774,"githubUrl":"https://github.com/zed-industries/zed/blob/f4178619acd0d47ea1f76a2025c42962c6d6638c/crates/zeta_prompt/src/multi_region.rs#L738-L774","documentation":"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.","triggerScenarios":"Thrown at crates/zeta_prompt/src/multi_region.rs:756 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","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)"],"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"}