From 85d601e622545f1bc29b2e8def550c6b96f32377 Mon Sep 17 00:00:00 2001 From: Richard Abrich Date: Mon, 9 Dec 2024 17:40:27 -0500 Subject: [PATCH] fix(models): remove active_browser_element / available_browser_elements --- openadapt/models.py | 13 ++++--------- openadapt/utils.py | 4 +++- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/openadapt/models.py b/openadapt/models.py index 131652f13..b2286b812 100644 --- a/openadapt/models.py +++ b/openadapt/models.py @@ -492,10 +492,6 @@ def to_prompt_dict(self) -> dict[str, Any]: Returns: dictionary containing relevant properties from the ActionEvent. """ - if self.active_browser_element: - import ipdb - - ipdb.set_trace() action_dict = deepcopy( { key: val @@ -518,6 +514,9 @@ def to_prompt_dict(self) -> dict[str, Any]: action_dict["available_segment_descriptions"] = ( self.available_segment_descriptions ) + + # TODO: + """ if self.active_browser_element: action_dict["active_browser_element"] = str(self.active_browser_element) if self.available_browser_elements: @@ -526,11 +525,7 @@ def to_prompt_dict(self) -> dict[str, Any]: action_dict["available_browser_elements"] = str( self.available_browser_elements ) - - if self.active_browser_element: - import ipdb - - ipdb.set_trace() + """ return action_dict @property diff --git a/openadapt/utils.py b/openadapt/utils.py index c57763694..9fbfd720c 100644 --- a/openadapt/utils.py +++ b/openadapt/utils.py @@ -961,9 +961,11 @@ def wrapper_retry(*args: tuple, **kwargs: dict[str, Any]) -> Any: logger.warning(exc) exceptions.append(str(exc)) retries += 1 + last_exception = exc + # Raise the final exception with a detailed message and keep its traceback raise RuntimeError( f"Failed after {max_retries} retries with exceptions: {exceptions}" - ) + ) from last_exception return wrapper_retry