zed-industries/zed · error

start and end markers are the same (marker {})

Error message

start and end markers are the same (marker {})

What it means

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.

Source

Thrown at crates/zeta_prompt/src/multi_region.rs:364

    let start_num: usize = text[first_num_start..first_num_end]
        .parse()
        .context("start marker number is not a valid integer")?;
    let first_tag_end = first_num_end + MARKER_TAG_SUFFIX.len();

    let last_tag_start = text
        .rfind(MARKER_TAG_PREFIX)
        .context("no end marker found in output")?;
    let last_num_start = last_tag_start + MARKER_TAG_PREFIX.len();
    let last_num_end = text[last_num_start..]
        .find(MARKER_TAG_SUFFIX)
        .map(|i| i + last_num_start)
        .context("malformed end marker tag")?;
    let end_num: usize = text[last_num_start..last_num_end]
        .parse()
        .context("end marker number is not a valid integer")?;

    if start_num == end_num {
        return Err(anyhow!(
            "start and end markers are the same (marker {})",
            start_num
        ));
    }

    let mut content_start = first_tag_end;
    if text.as_bytes().get(content_start) == Some(&b'\n') {
        content_start += 1;
    }
    let content_end = last_tag_start;

    let content = &text[content_start..content_end.max(content_start)];
    let content = strip_marker_tags(content);
    Ok((start_num, end_num, content))
}

/// Given old editable text and model output with marker span, reconstruct the
/// full new editable region.

View on GitHub (pinned to f4178619ac)

Solutions

  1. Retry the model request so start and end markers differ
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at crates/zeta_prompt/src/multi_region.rs:364 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/b9054b0b28d97e51. Report an issue: GitHub.