from __future__ import annotations


class SessionNotFoundError(KeyError):
    """Raised when a session cannot be found."""

    def __init__(self, session_id: str, suggestions: list[str] | None = None):
        self.session_id = session_id
        self.suggestions = suggestions or []
        message = f"Session not found: {session_id}"
        if self.suggestions:
            message += "\n\nDid you mean one of these?\n"
            message += "\n".join(f"  - {candidate}" for candidate in self.suggestions[:5])
        else:
            message += "\n\nUse list_sessions() to see available sessions."
        super().__init__(message)
