HKUDS/DeepTutor · error · ValueError

session_id must not be empty

Error message

session_id must not be empty

What it means

Error "session_id must not be empty" thrown in HKUDS/DeepTutor.

Source

Thrown at deeptutor/learning/storage.py:684

    def list_all(self) -> list[str]:
        with self._connect() as conn:
            stored = {
                str(row["path_id"])
                for row in conn.execute("SELECT path_id FROM mastery_paths").fetchall()
            }
        legacy = {
            path.stem for path in Path(self._root).glob("*.json") if not path.name.startswith(".")
        }
        return sorted(stored | legacy)

    # ---- explicit path/session ownership ---------------------------------

    def bind_session(self, path_id: str, session_id: str, *, owns_path: bool = False) -> None:
        path_id = self._validate_id(path_id)
        self._import_legacy_if_needed(path_id)
        session_id = str(session_id or "").strip()
        if not session_id:
            raise ValueError("session_id must not be empty")
        now = time.time()
        with self._connect() as conn:
            conn.execute("BEGIN IMMEDIATE")
            try:
                row = conn.execute(
                    "SELECT 1 FROM mastery_paths WHERE path_id = ?", (path_id,)
                ).fetchone()
                if row is None:
                    progress = LearningProgress(book_id=path_id)
                    progress.version = 1
                    progress.updated_at = now
                    conn.execute(
                        """
                        INSERT INTO mastery_paths (
                            path_id, state_json, revision, created_at, updated_at
                        ) VALUES (?, ?, 1, ?, ?)
                        """,
                        (

View on GitHub (pinned to 3e82f13042)

When it happens

Trigger: Thrown at deeptutor/learning/storage.py:684 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of HKUDS/DeepTutor@3e82f13042 (2026-08-27). Data as JSON: /api/errors/8c6d457920d56276. Report an issue: GitHub.