{"record":{"id":"7d7e1bd2cf7cf011","repo":"bytedance/deer-flow","slug":"openviking-api-key-env-must-not-be-empty","errorCode":null,"errorMessage":"OpenViking api_key_env must not be empty","messagePattern":"OpenViking api_key_env must not be empty","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"backend/packages/harness/deerflow/agents/memory/backends/openviking/config.py","lineNumber":68,"sourceCode":"    def from_backend_config(\n        cls,\n        backend_config: dict[str, Any] | None,\n    ) -> OpenVikingConfig:\n        cfg = dict(backend_config or {})\n        if \"auth_mode\" in cfg or \"account\" in cfg:\n            raise ValueError(\"OpenViking trusted mode is no longer supported by this backend; use a USER API key and configure owner_user_id\")\n        removed_fields = sorted(_REMOVED_CUSTOM_HTTP_FIELDS.intersection(cfg))\n        if removed_fields:\n            raise ValueError(\"OpenViking custom HTTP client fields are no longer supported: \" + \", \".join(removed_fields))\n\n        retrieval = _mapping(cfg.pop(\"retrieval\", {}), \"retrieval\")\n        failure_policy = _mapping(\n            cfg.pop(\"failure_policy\", {}),\n            \"failure_policy\",\n        )\n        api_key_env = str(cfg.pop(\"api_key_env\", \"OPENVIKING_API_KEY\")).strip()\n        if not api_key_env:\n            raise ValueError(\"OpenViking api_key_env must not be empty\")\n\n        result = cls(\n            base_url=str(cfg.pop(\"base_url\", \"http://127.0.0.1:1933\")).rstrip(\"/\"),\n            storage_path=str(cfg.pop(\"storage_path\", \"\")),\n            owner_user_id=str(cfg.pop(\"owner_user_id\", \"\")).strip(),\n            api_key=os.environ.get(api_key_env, \"\").strip(),\n            api_key_env=api_key_env,\n            default_peer_id=str(cfg.pop(\"default_peer_id\", \"deerflow\")).strip(),\n            timeout_seconds=float(cfg.pop(\"timeout_seconds\", 30.0)),\n            search_top_k=int(retrieval.pop(\"top_k\", 8)),\n            score_threshold=_optional_float(retrieval.pop(\"score_threshold\", None)),\n            max_injection_chars=int(retrieval.pop(\"max_injection_chars\", 12_000)),\n            content_mode=str(retrieval.pop(\"content_mode\", \"overview\")).lower(),  # type: ignore[arg-type]\n            injection_query=str(\n                retrieval.pop(\n                    \"injection_query\",\n                    \"user profile preferences important entities events ongoing goals constraints and prior decisions\",\n                )","sourceCodeStart":50,"sourceCodeEnd":86,"githubUrl":"https://github.com/bytedance/deer-flow/blob/1dd6ba1acb03700589994b0366c5d1c7d05e2eff/backend/packages/harness/deerflow/agents/memory/backends/openviking/config.py#L50-L86","documentation":"Error \"OpenViking api_key_env must not be empty\" thrown in bytedance/deer-flow.","triggerScenarios":"Thrown at backend/packages/harness/deerflow/agents/memory/backends/openviking/config.py:68 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set api_key_env to the name of the environment variable holding the OpenViking USER API key.","Remove the field only if a default is documented; otherwise it is required."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"1dd6ba1acb03700589994b0366c5d1c7d05e2eff","analyzedAt":"2026-08-14T21:20:34.804Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}