{"record":{"id":"d66c2b821690fca9","repo":"HKUDS/DeepTutor","slug":"no-mastery-path-path-id-r-exists-call-mastery-p","errorCode":null,"errorMessage":"No mastery path {path_id!r} exists. Call mastery_paths for the ids you can switch to, or mastery_build to create one here.","messagePattern":"No mastery path (.+?) exists\\. Call mastery_paths for the ids you can switch to, or mastery_build to create one here\\.","errorType":"exception","errorClass":"PathBindingError","httpStatus":null,"severity":"error","filePath":"deeptutor/capabilities/mastery/binding.py","lineNumber":63,"sourceCode":"    session_id: str,\n    turn_id: str,\n    bind_turn: PathBinder | None,\n    require_existing: bool = True,\n) -> str:\n    \"\"\"Move this turn (and the conversation) onto ``path_id``.\n\n    Returns the resolved path id. Raises :class:`PathBindingError` when the\n    target does not exist or is busy in another conversation.\n    \"\"\"\n    from deeptutor.learning.storage import (\n        LearningStore,\n        PathLeaseConflictError,\n    )\n\n    target = sanitize_mastery_path_id(path_id)\n    store = LearningStore()\n    if require_existing and not await asyncio.to_thread(store.exists, target):\n        raise PathBindingError(\n            f\"No mastery path {path_id!r} exists. Call mastery_paths for the \"\n            \"ids you can switch to, or mastery_build to create one here.\"\n        )\n\n    # One lease row per turn: the old one has to go before the new one can be\n    # taken, and both are scoped to this turn so a concurrent conversation on\n    # either path is never disturbed.\n    released = await asyncio.to_thread(store.release_leases_for_turn, turn_id)\n    try:\n        await asyncio.to_thread(store.acquire_path_lease, target, session_id, turn_id)\n    except PathLeaseConflictError as exc:\n        # Put the learner back where they were rather than stranding the turn\n        # with no lease at all.\n        if released and released != target:\n            with contextlib.suppress(Exception):\n                await asyncio.to_thread(store.acquire_path_lease, released, session_id, turn_id)\n        raise PathBindingError(\n            f\"Mastery path {target!r} is being tutored in another conversation \"","sourceCodeStart":45,"sourceCodeEnd":81,"githubUrl":"https://github.com/HKUDS/DeepTutor/blob/3e82f130422a813cdd73c10b21a44e9325f5821a/deeptutor/capabilities/mastery/binding.py#L45-L81","documentation":"Error \"No mastery path {path_id!r} exists. Call mastery_paths for the ids you can switch to, or mastery_build to create one here.\" thrown in HKUDS/DeepTutor.","triggerScenarios":"Thrown at deeptutor/capabilities/mastery/binding.py:63 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"}