HKUDS/DeepTutor · error · PathBindingError
Mastery path is being tutored in another conversation right…
Error message
Mastery path {target!r} is being tutored in another conversation right now (session {exc.lease.session_id!r}). Try again once that turn finishes. What it means
Lease-conflict translation in rebind_active_path: PathLeaseConflictError fired because another conversation currently holds the tutoring lease on the target path (one active tutor per path). The message names the conflicting session so the caller knows where it is busy.
Solutions
- Retry once the other conversation's turn finishes
- Close or end the session holding the lease, then rebind
- Switch to a different mastery path if the conflict persists
Defensive patterns
Strategy: retry
When it happens
Trigger: Thrown at deeptutor/capabilities/mastery/binding.py:80 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/0c1d4833bee4bfef.
Report an issue: GitHub.
Appendix: source
Thrown at deeptutor/capabilities/mastery/binding.py:80
if require_existing and not await asyncio.to_thread(store.exists, target):
raise PathBindingError(
f"No mastery path {path_id!r} exists. Call mastery_paths for the "
"ids you can switch to, or mastery_build to create one here."
)
# One lease row per turn: the old one has to go before the new one can be
# taken, and both are scoped to this turn so a concurrent conversation on
# either path is never disturbed.
released = await asyncio.to_thread(store.release_leases_for_turn, turn_id)
try:
await asyncio.to_thread(store.acquire_path_lease, target, session_id, turn_id)
except PathLeaseConflictError as exc:
# Put the learner back where they were rather than stranding the turn
# with no lease at all.
if released and released != target:
with contextlib.suppress(Exception):
await asyncio.to_thread(store.acquire_path_lease, released, session_id, turn_id)
raise PathBindingError(
f"Mastery path {target!r} is being tutored in another conversation "
f"right now (session {exc.lease.session_id!r}). Try again once that "
"turn finishes."
) from exc
_apply(bind_turn, target)
await _remember_on_session(session_id, target)
return target
async def leave_active_path(
*,
session_id: str,
turn_id: str,
bind_turn: PathBinder | None,
) -> str:
"""Detach the conversation from any named path.
View on GitHub (pinned to 3e82f13042)