{"record":{"id":"8c6d457920d56276","repo":"HKUDS/DeepTutor","slug":"session-id-must-not-be-empty","errorCode":null,"errorMessage":"session_id must not be empty","messagePattern":"session_id must not be empty","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"deeptutor/learning/storage.py","lineNumber":684,"sourceCode":"    def list_all(self) -> list[str]:\n        with self._connect() as conn:\n            stored = {\n                str(row[\"path_id\"])\n                for row in conn.execute(\"SELECT path_id FROM mastery_paths\").fetchall()\n            }\n        legacy = {\n            path.stem for path in Path(self._root).glob(\"*.json\") if not path.name.startswith(\".\")\n        }\n        return sorted(stored | legacy)\n\n    # ---- explicit path/session ownership ---------------------------------\n\n    def bind_session(self, path_id: str, session_id: str, *, owns_path: bool = False) -> None:\n        path_id = self._validate_id(path_id)\n        self._import_legacy_if_needed(path_id)\n        session_id = str(session_id or \"\").strip()\n        if not session_id:\n            raise ValueError(\"session_id must not be empty\")\n        now = time.time()\n        with self._connect() as conn:\n            conn.execute(\"BEGIN IMMEDIATE\")\n            try:\n                row = conn.execute(\n                    \"SELECT 1 FROM mastery_paths WHERE path_id = ?\", (path_id,)\n                ).fetchone()\n                if row is None:\n                    progress = LearningProgress(book_id=path_id)\n                    progress.version = 1\n                    progress.updated_at = now\n                    conn.execute(\n                        \"\"\"\n                        INSERT INTO mastery_paths (\n                            path_id, state_json, revision, created_at, updated_at\n                        ) VALUES (?, ?, 1, ?, ?)\n                        \"\"\",\n                        (","sourceCodeStart":666,"sourceCodeEnd":702,"githubUrl":"https://github.com/HKUDS/DeepTutor/blob/3e82f130422a813cdd73c10b21a44e9325f5821a/deeptutor/learning/storage.py#L666-L702","documentation":"Error \"session_id must not be empty\" thrown in HKUDS/DeepTutor.","triggerScenarios":"Thrown at deeptutor/learning/storage.py:684 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"3e82f130422a813cdd73c10b21a44e9325f5821a","analyzedAt":"2026-08-27T06:57:25.364Z","schemaVersion":2},"datasetVersion":"2026-08-27T08:17:20.692Z"}