{"record":{"id":"3f9233e28d1f8224","repo":"deepseek-ai/deepseek-harness","slug":"pass-either-deepseekharnessconfig-or-keyword-optio","errorCode":null,"errorMessage":"pass either DeepSeekHarnessConfig or keyword options, not both","messagePattern":"pass either DeepSeekHarnessConfig or keyword options, not both","errorType":"exception","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"python/sdk/src/deepseek_harness/api.py","lineNumber":58,"sourceCode":"    session_id: str\n    final_response: str\n    finish_reason: str | None\n    events: list[JsonObject]\n    notifications: list[Notification]\n    session_root: str | None = None\n\n\nclass DeepSeekHarness:\n    \"\"\"Reusable synchronous SDK for running DeepSeek Harness agent turns.\n\n    The runtime subprocess starts lazily and remains owned by this instance\n    across calls to :meth:`run`. Use the instance as a context manager, or call\n    :meth:`close` explicitly when finished, so the subprocess is always reaped.\n    \"\"\"\n\n    def __init__(self, config: DeepSeekHarnessConfig | None = None, **kwargs: object) -> None:\n        if config is not None and kwargs:\n            raise TypeError(\"pass either DeepSeekHarnessConfig or keyword options, not both\")\n        self.config = config or DeepSeekHarnessConfig(**kwargs)\n        cwd = str(Path(self.config.cwd or Path.cwd()).resolve())\n        runtime_cwd = str(Path(self.config.runtime_cwd).resolve()) if self.config.runtime_cwd is not None else cwd\n        self._cwd = cwd\n        env = dict(self.config.env)\n        if self.config.session_root is not None:\n            env[\"DSH_SESSION_ROOT\"] = self.config.session_root\n        if self.config.cordis is not None:\n            env[\"DSH_CORDIS_CONFIG\"] = self.config.cordis\n        env[\"DSH_CWD\"] = cwd\n        if self.config.base_url is not None:\n            env[\"DEEPSEEK_BASE_URL\"] = self.config.base_url\n        if self.config.api_key is not None:\n            env[\"DEEPSEEK_API_KEY\"] = self.config.api_key\n\n        self._client = HarnessClient(\n            HarnessConfig(\n                runtime_bin=self.config.runtime_bin,","sourceCodeStart":40,"sourceCodeEnd":76,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/python/sdk/src/deepseek_harness/api.py#L40-L76","documentation":"Error \"pass either DeepSeekHarnessConfig or keyword options, not both\" thrown in deepseek-ai/deepseek-harness.","triggerScenarios":"Thrown at python/sdk/src/deepseek_harness/api.py:58 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass either a DeepSeekHarnessConfig instance or keyword options to the constructor, not both."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"b150a551b8d465e31e418e1b2eaf5e79bbb7d28e","analyzedAt":"2026-08-24T18:12:29.105Z","schemaVersion":2},"datasetVersion":"2026-08-24T22:17:12.610Z"}