{"record":{"id":"0320644e6d594b17","repo":"bytedance/deer-flow","slug":"openviking-max-seen-message-ids-must-be-between-16","errorCode":null,"errorMessage":"OpenViking max_seen_message_ids must be between 16 and 10000","messagePattern":"OpenViking max_seen_message_ids must be between 16 and 10000","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"backend/packages/harness/deerflow/agents/memory/backends/openviking/config.py","lineNumber":143,"sourceCode":"            raise ValueError(\"OpenViking timeout_seconds must be a finite value > 0\")\n        if not 1 <= self.search_top_k <= 100:\n            raise ValueError(\"OpenViking retrieval.top_k must be between 1 and 100\")\n        if self.score_threshold is not None and (not isfinite(self.score_threshold) or not 0 <= self.score_threshold <= 1):\n            raise ValueError(\"OpenViking retrieval.score_threshold must be a finite value between 0 and 1\")\n        if not 256 <= self.max_injection_chars <= 100_000:\n            raise ValueError(\"OpenViking retrieval.max_injection_chars must be between 256 and 100000\")\n        if self.content_mode not in {\"auto\", \"abstract\", \"overview\", \"read\"}:\n            raise ValueError(\"OpenViking retrieval.content_mode must be auto, abstract, overview, or read\")\n        if not self.injection_query:\n            raise ValueError(\"OpenViking retrieval.injection_query must not be empty\")\n        if self.startup_policy not in {\"fail_fast\", \"warn\"}:\n            raise ValueError(\"OpenViking startup_policy must be 'fail_fast' or 'warn'\")\n        if self.read_failure_policy not in {\"fail_open\", \"raise\"}:\n            raise ValueError(\"OpenViking failure_policy.read must be 'fail_open' or 'raise'\")\n        if self.write_failure_policy not in {\"log_and_drop\", \"raise\"}:\n            raise ValueError(\"OpenViking failure_policy.write must be 'log_and_drop' or 'raise'\")\n        if not 16 <= self.max_seen_message_ids <= 10_000:\n            raise ValueError(\"OpenViking max_seen_message_ids must be between 16 and 10000\")\n\n\ndef is_safe_peer_id(value: str) -> bool:\n    \"\"\"Return whether *value* is valid for an OpenViking actor peer.\"\"\"\n\n    return _SAFE_PEER_RE.fullmatch(value) is not None\n\n\ndef _mapping(value: Any, name: str) -> dict[str, Any]:\n    if value is None:\n        return {}\n    if not isinstance(value, dict):\n        raise ValueError(f\"OpenViking {name} must be a mapping\")\n    return dict(value)\n\n\ndef _optional_float(value: Any) -> float | None:\n    return None if value is None else float(value)","sourceCodeStart":125,"sourceCodeEnd":161,"githubUrl":"https://github.com/bytedance/deer-flow/blob/1dd6ba1acb03700589994b0366c5d1c7d05e2eff/backend/packages/harness/deerflow/agents/memory/backends/openviking/config.py#L125-L161","documentation":"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).","triggerScenarios":"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.","commonSituations":"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.","solutions":["Set memory.backend_config.max_seen_message_ids to a value in [16, 10000]; 512 is the default and suits most threads","Omit the key to accept the default 512","Restart the Gateway after the config edit"],"exampleFix":"# before (config.yaml)\nmemory:\n  backend_config:\n    max_seen_message_ids: 8   # below the floor of 16\n\n# after\nmemory:\n  backend_config:\n    max_seen_message_ids: 512","handlingStrategy":"validation","validationCode":"val = int(raw_backend_config.get(\"max_seen_message_ids\", 512))\nassert 16 <= val <= 10_000, f\"max_seen_message_ids must be in [16, 10000], got {val}\"","typeGuard":"def is_valid_max_seen(value: object) -> bool:\n    return isinstance(value, int) and not isinstance(value, bool) and 16 <= value <= 10_000","tryCatchPattern":null,"preventionTips":["Leave max_seen_message_ids at the default 512 unless a measured dedup problem justifies changing it","Validate integer ranges in config preflight before startup","Never lower it below 16 to force re-capture; use a fresh thread instead"],"tags":["openviking","config","validation","limits"],"backgroundTag":null,"analyzedSha":"1dd6ba1acb03700589994b0366c5d1c7d05e2eff","analyzedAt":"2026-08-14T21:20:34.804Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}