From d554ab0692a8b8ab11f16974f2f9e265be60d6f6 Mon Sep 17 00:00:00 2001 From: Patrice Bechard Date: Tue, 28 Oct 2025 12:38:47 -0400 Subject: [PATCH 1/2] address comments --- src/agentlab/agents/hint_use_agent/generic_agent.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/agentlab/agents/hint_use_agent/generic_agent.py b/src/agentlab/agents/hint_use_agent/generic_agent.py index afc688ed..05bcd673 100644 --- a/src/agentlab/agents/hint_use_agent/generic_agent.py +++ b/src/agentlab/agents/hint_use_agent/generic_agent.py @@ -271,6 +271,9 @@ def _init_hints_index(self): """Initialize the block.""" try: if self.flags.hint_type == "docs": + if self.flags.hint_index_type == "direct": + print("WARNING: Hint index type 'direct' is not supported for docs. Using 'sparse' instead.") + self.flags.hint_index_type = "sparse" if self.flags.hint_index_type == "sparse": import bm25s @@ -323,10 +326,12 @@ def _get_task_hints(self) -> list[str]: return [] if self.flags.hint_type == "docs": + if self.flags.hint_index_type == "direct": + print("WARNING: Hint index type 'direct' is not supported for docs. Using 'sparse' instead.") + self.flags.hint_index_type = "sparse" if not hasattr(self, "hint_index"): - print("Initializing hint index new time") - # @patricebechard It seems _.init() method is missing do we still need it? - # self._init() + print("WARNING: Hint index not initialized. Initializing now.") + self._init_hints_index() if self.flags.hint_query_type == "goal": query = self.obs_history[-1]["goal_object"][0]["text"] elif self.flags.hint_query_type == "llm": @@ -334,7 +339,6 @@ def _get_task_hints(self) -> list[str]: # HACK: only 1 query supported query = queries[0] else: - # @patricebechard: This raises an error with the default value 'direct' raise ValueError(f"Unknown hint query type: {self.flags.hint_query_type}") print(f"Query: {query}") From d1cd785fe852b163dd3ee53746327e8ed8fa8167 Mon Sep 17 00:00:00 2001 From: Patrice Bechard Date: Tue, 28 Oct 2025 12:42:11 -0400 Subject: [PATCH 2/2] format --- src/agentlab/agents/hint_use_agent/generic_agent.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/agentlab/agents/hint_use_agent/generic_agent.py b/src/agentlab/agents/hint_use_agent/generic_agent.py index 05bcd673..f4010f70 100644 --- a/src/agentlab/agents/hint_use_agent/generic_agent.py +++ b/src/agentlab/agents/hint_use_agent/generic_agent.py @@ -272,7 +272,9 @@ def _init_hints_index(self): try: if self.flags.hint_type == "docs": if self.flags.hint_index_type == "direct": - print("WARNING: Hint index type 'direct' is not supported for docs. Using 'sparse' instead.") + print( + "WARNING: Hint index type 'direct' is not supported for docs. Using 'sparse' instead." + ) self.flags.hint_index_type = "sparse" if self.flags.hint_index_type == "sparse": import bm25s @@ -327,7 +329,9 @@ def _get_task_hints(self) -> list[str]: if self.flags.hint_type == "docs": if self.flags.hint_index_type == "direct": - print("WARNING: Hint index type 'direct' is not supported for docs. Using 'sparse' instead.") + print( + "WARNING: Hint index type 'direct' is not supported for docs. Using 'sparse' instead." + ) self.flags.hint_index_type = "sparse" if not hasattr(self, "hint_index"): print("WARNING: Hint index not initialized. Initializing now.")