π OpenHands: AI-Driven Development
APP-1366 Removed V0 Critic (#14056)
Tim O'Farrellc49ed64b6494
diff --git a/openhands/critic/__init__.py b/openhands/critic/__init__.pydeleted file mode 100644index 5092a49cc4..0000000000--- a/openhands/critic/__init__.py+++ /dev/null@@ -1,4 +0,0 @@-from .base import BaseCritic, CriticResult-from .finish_critic import AgentFinishedCritic--__all__ = ['CriticResult', 'BaseCritic', 'AgentFinishedCritic']diff --git a/openhands/critic/base.py b/openhands/critic/base.pydeleted file mode 100644index 3a7def922f..0000000000--- a/openhands/critic/base.py+++ /dev/null@@ -1,27 +0,0 @@-import abc--from pydantic import BaseModel--from openhands.events import Event---class CriticResult(BaseModel):- """A critic result is a score and a message."""-- score: float- message: str-- @property- def success(self) -> bool:- """Whether the agent is successful."""- return self.score >= 0.5---class BaseCritic(abc.ABC):- """A critic is a function that takes in a list of events, optional git patch, and returns a score about the quality of those events."""-- @abc.abstractmethod- def evaluate(- self, events: list[Event], git_patch: str | None = None- ) -> CriticResult:- passdiff --git a/openhands/critic/finish_critic.py b/openhands/critic/finish_critic.pydeleted file mode 100644index ca8dcd872b..0000000000--- a/openhands/critic/finish_critic.py+++ /dev/null@@ -1,26 +0,0 @@-from openhands.critic.base import BaseCritic, CriticResult-from openhands.events import Event-from openhands.events.action import Action, AgentFinishAction---class AgentFinishedCritic(BaseCritic):- """This is a simple rule-based critic that checks if the last event is an AgentFinishAction.- If not, it will return a score of 0 and a message indicating that the agent did not finish.- If the git patch is provided and is empty, it will return a score of 0 and a message indicating that the git patch is empty.- """-- def __init__(self):- pass-- def evaluate(- self, events: list[Event], git_patch: str | None = None- ) -> CriticResult:- last_action = next((h for h in reversed(events) if isinstance(h, Action)), None)-- if git_patch is not None and len(git_patch.strip()) == 0:- return CriticResult(score=0, message='Git patch is empty.')-- if isinstance(last_action, AgentFinishAction):- return CriticResult(score=1, message='Agent finished.')- else:- return CriticResult(score=0, message='Agent did not finish.')