bytedance/deer-flow · error · ValueError

OpenViking max_seen_message_ids must be between 16 and 10000

Error message

OpenViking max_seen_message_ids must be between 16 and 10000

What it means

OpenVikingConfig._validate() enforces 16 <= memory.backend_config.max_seen_message_ids <= 10000 (default 512). This field bounds the seen-message-ID set kept in the per-session capture cursor, which prevents replaying already-captured messages; values outside the range are rejected as either unsafe (too small) or unbounded memory growth (too large).

Source

Thrown at backend/packages/harness/deerflow/agents/memory/backends/openviking/config.py:143

            raise ValueError("OpenViking timeout_seconds must be a finite value > 0")
        if not 1 <= self.search_top_k <= 100:
            raise ValueError("OpenViking retrieval.top_k must be between 1 and 100")
        if self.score_threshold is not None and (not isfinite(self.score_threshold) or not 0 <= self.score_threshold <= 1):
            raise ValueError("OpenViking retrieval.score_threshold must be a finite value between 0 and 1")
        if not 256 <= self.max_injection_chars <= 100_000:
            raise ValueError("OpenViking retrieval.max_injection_chars must be between 256 and 100000")
        if self.content_mode not in {"auto", "abstract", "overview", "read"}:
            raise ValueError("OpenViking retrieval.content_mode must be auto, abstract, overview, or read")
        if not self.injection_query:
            raise ValueError("OpenViking retrieval.injection_query must not be empty")
        if self.startup_policy not in {"fail_fast", "warn"}:
            raise ValueError("OpenViking startup_policy must be 'fail_fast' or 'warn'")
        if self.read_failure_policy not in {"fail_open", "raise"}:
            raise ValueError("OpenViking failure_policy.read must be 'fail_open' or 'raise'")
        if self.write_failure_policy not in {"log_and_drop", "raise"}:
            raise ValueError("OpenViking failure_policy.write must be 'log_and_drop' or 'raise'")
        if not 16 <= self.max_seen_message_ids <= 10_000:
            raise ValueError("OpenViking max_seen_message_ids must be between 16 and 10000")


def is_safe_peer_id(value: str) -> bool:
    """Return whether *value* is valid for an OpenViking actor peer."""

    return _SAFE_PEER_RE.fullmatch(value) is not None


def _mapping(value: Any, name: str) -> dict[str, Any]:
    if value is None:
        return {}
    if not isinstance(value, dict):
        raise ValueError(f"OpenViking {name} must be a mapping")
    return dict(value)


def _optional_float(value: Any) -> float | None:
    return None if value is None else float(value)

View on GitHub (pinned to 1dd6ba1acb)

Solutions

  1. Set memory.backend_config.max_seen_message_ids to a value in [16, 10000]; 512 is the default and suits most threads
  2. Omit the key to accept the default 512
  3. Restart the Gateway after the config edit

Example fix

# before (config.yaml)
memory:
  backend_config:
    max_seen_message_ids: 8   # below the floor of 16

# after
memory:
  backend_config:
    max_seen_message_ids: 512
Defensive patterns

Strategy: validation

Validate before calling

val = int(raw_backend_config.get("max_seen_message_ids", 512))
assert 16 <= val <= 10_000, f"max_seen_message_ids must be in [16, 10000], got {val}"

Type guard

def is_valid_max_seen(value: object) -> bool:
    return isinstance(value, int) and not isinstance(value, bool) and 16 <= value <= 10_000

Prevention

When it happens

Trigger: Setting memory.backend_config.max_seen_message_ids below 16 or above 10000 in config.yaml, e.g. 8 or 20000. The value is coerced with int(), so non-integer strings raise a different (TypeError/ValueError from int) error first. Raised during config validation at manager construction.

Common situations: Operators lowering it to 1 hoping to force re-capture of every turn (breaks dedup safety), or raising it far above 10000 for very long threads without realizing each session cursor file grows with the set.

Related errors


AI-assisted analysis of bytedance/deer-flow@1dd6ba1acb (2026-08-14). Data as JSON: /api/errors/0320644e6d594b17. Report an issue: GitHub.