"""
PassCritic implementation.

This critic always returns success, useful when no evaluation is needed
or when all instances should be considered successful.
"""

from collections.abc import Sequence

from openhands.sdk.critic.base import CriticBase, CriticResult
from openhands.sdk.event import LLMConvertibleEvent
from openhands.sdk.logger import get_logger


logger = get_logger(__name__)


class PassCritic(CriticBase):
    """
    Critic that always returns success.

    This critic can be used when no evaluation is needed or when
    all instances should be considered successful regardless of their output.
    """

    def evaluate(
        self,
        events: Sequence[LLMConvertibleEvent],  # noqa: ARG002
        git_patch: str | None = None,  # noqa: ARG002
    ) -> CriticResult:
        """
        Always evaluate as successful.

        Args:
            events: List of events from the agent's execution (not used)
            git_patch: Optional git patch generated by the agent (not used)

        Returns:
            CriticResult with score 1.0 (always successful)
        """
        logger.debug("PassCritic: Always returns success")
        return CriticResult(score=1.0, message="PassCritic always succeeds")
