From d91c9ccd886aeb0e73f1624ac4bc9fd321f9641e Mon Sep 17 00:00:00 2001 From: datvo06 Date: Tue, 23 Sep 2025 10:40:36 -0400 Subject: [PATCH 1/2] Adding unreachable plan --- predicators/approaches/vlm_open_loop_approach.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/predicators/approaches/vlm_open_loop_approach.py b/predicators/approaches/vlm_open_loop_approach.py index 4245a9285..3a448547a 100644 --- a/predicators/approaches/vlm_open_loop_approach.py +++ b/predicators/approaches/vlm_open_loop_approach.py @@ -20,6 +20,7 @@ from typing import Callable, List, Sequence, Set +import logging import numpy as np import PIL from PIL import ImageDraw @@ -150,6 +151,15 @@ def _solve(self, task: Task, timeout: int) -> Callable[[State], Action]: try: option_plan = self._query_vlm_for_option_plan(task) except Exception as e: + if CFG.planning_check_dr_reachable: + try: + init_atoms = utils.abstract(task.init, + self._get_current_predicates()) + except Exception: # pragma: no cover - best-effort logging only + init_atoms = set() + logging.info(f"Detected goal unreachable. Goal: {task.goal}") + logging.info(f"Initial atoms: {init_atoms}") + raise ApproachFailure(f"Goal {task.goal} not dr-reachable") raise ApproachFailure( f"VLM failed to produce coherent option plan. Reason: {e}") From 660377654eccfbd82ede96ce6d38c29ffcffb79f Mon Sep 17 00:00:00 2001 From: datvo06 Date: Tue, 23 Sep 2025 10:42:19 -0400 Subject: [PATCH 2/2] Raise correct exception --- predicators/approaches/vlm_open_loop_approach.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/predicators/approaches/vlm_open_loop_approach.py b/predicators/approaches/vlm_open_loop_approach.py index 3a448547a..fee0f3317 100644 --- a/predicators/approaches/vlm_open_loop_approach.py +++ b/predicators/approaches/vlm_open_loop_approach.py @@ -27,6 +27,7 @@ from predicators import utils from predicators.approaches import ApproachFailure +from predicators.planning import PlanningFailure from predicators.approaches.bilevel_planning_approach import \ BilevelPlanningApproach from predicators.nsrt_learning.segmentation import segment_trajectory @@ -159,7 +160,7 @@ def _solve(self, task: Task, timeout: int) -> Callable[[State], Action]: init_atoms = set() logging.info(f"Detected goal unreachable. Goal: {task.goal}") logging.info(f"Initial atoms: {init_atoms}") - raise ApproachFailure(f"Goal {task.goal} not dr-reachable") + raise PlanningFailure(f"Goal {task.goal} not dr-reachable") raise ApproachFailure( f"VLM failed to produce coherent option plan. Reason: {e}")