{"record":{"id":"b9054b0b28d97e51","repo":"zed-industries/zed","slug":"start-and-end-markers-are-the-same-marker","errorCode":null,"errorMessage":"start and end markers are the same (marker {})","messagePattern":"start and end markers are the same \\(marker (.+?)\\)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/zeta_prompt/src/multi_region.rs","lineNumber":364,"sourceCode":"    let start_num: usize = text[first_num_start..first_num_end]\n        .parse()\n        .context(\"start marker number is not a valid integer\")?;\n    let first_tag_end = first_num_end + MARKER_TAG_SUFFIX.len();\n\n    let last_tag_start = text\n        .rfind(MARKER_TAG_PREFIX)\n        .context(\"no end marker found in output\")?;\n    let last_num_start = last_tag_start + MARKER_TAG_PREFIX.len();\n    let last_num_end = text[last_num_start..]\n        .find(MARKER_TAG_SUFFIX)\n        .map(|i| i + last_num_start)\n        .context(\"malformed end marker tag\")?;\n    let end_num: usize = text[last_num_start..last_num_end]\n        .parse()\n        .context(\"end marker number is not a valid integer\")?;\n\n    if start_num == end_num {\n        return Err(anyhow!(\n            \"start and end markers are the same (marker {})\",\n            start_num\n        ));\n    }\n\n    let mut content_start = first_tag_end;\n    if text.as_bytes().get(content_start) == Some(&b'\\n') {\n        content_start += 1;\n    }\n    let content_end = last_tag_start;\n\n    let content = &text[content_start..content_end.max(content_start)];\n    let content = strip_marker_tags(content);\n    Ok((start_num, end_num, content))\n}\n\n/// Given old editable text and model output with marker span, reconstruct the\n/// full new editable region.","sourceCodeStart":346,"sourceCodeEnd":382,"githubUrl":"https://github.com/zed-industries/zed/blob/f4178619acd0d47ea1f76a2025c42962c6d6638c/crates/zeta_prompt/src/multi_region.rs#L346-L382","documentation":"Raised in extract_marker_span when the first and last marker tags in the model output carry the same marker number, i.e. the start and end of the edited span are the same marker. A well-formed span needs two distinct markers; the parse is rejected.","triggerScenarios":"Thrown at crates/zeta_prompt/src/multi_region.rs:364 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Retry the model request so start and end markers differ"],"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"}