BerriAI/litellm · error · ValueError

reminder_markers open and close must be different strings

Error message

reminder_markers open and close must be different strings

What it means

Pydantic validator on ReminderMarkerPair: open and close are the same string after normalization, which would make the injected-context scanner unable to pair delimiters, so the pair is rejected.

Source

Thrown at litellm/router_strategy/complexity_router/config.py:94

class ReminderMarkerPair(BaseModel):
    """One open/close delimiter pair a harness wraps injected context in.

    Normalizing here rather than at the scan is what makes matching case-insensitive: markers reach
    the scan already lowered, so it lowercases only the haystack and never the needles. Stripping
    keeps YAML indentation whitespace from becoming part of the delimiter.
    """

    open: str = Field(description="Opening delimiter, e.g. '<system-reminder>'")
    close: str = Field(description="Closing delimiter, e.g. '</system-reminder>'")

    @model_validator(mode="after")
    def _normalize(self) -> "ReminderMarkerPair":
        open_marker: Final = self.open.strip().lower()
        close_marker: Final = self.close.strip().lower()
        if not open_marker or not close_marker:
            raise ValueError("reminder_markers entries must not be blank")
        if open_marker == close_marker:
            raise ValueError("reminder_markers open and close must be different strings")
        self.open = open_marker
        self.close = close_marker
        return self


# ─── Default Keyword Lists ───
# Note: Keywords should be full words/phrases to avoid substring false positives.
# The matching logic uses word boundary detection for single-word keywords.

DEFAULT_CODE_KEYWORDS: Final[list[str]] = [
    "function",
    "class",
    "def",
    "const",
    "let",
    "var",
    "import",
    "export",

View on GitHub (pinned to 77b7c6c40c)

Solutions

  1. Use distinct strings for the open and close reminder markers.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at litellm/router_strategy/complexity_router/config.py:94 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of BerriAI/litellm@77b7c6c40c (2026-08-18). Data as JSON: /api/errors/16b6b07ab01e988c. Report an issue: GitHub.