diff --git a/reme/steps/index/search.py b/reme/steps/index/search.py index 9fee48a5..707359c4 100644 --- a/reme/steps/index/search.py +++ b/reme/steps/index/search.py @@ -158,9 +158,12 @@ class SearchStep(BaseStep): expand_links_enabled: bool = bool(self.kwargs.get("expand_links", True)) max_links_per_direction: int = int(self.kwargs.get("max_links_per_direction", 10)) tool_context_id: str = (self.context.get("tool_context_id", "") or "").strip() - strict_date_filter: bool = bool( - self.context.get("strict_date_filter") or self.kwargs.get("strict_date_filter", False), - ) + # Injected value takes precedence over YAML kwargs; check existence + # (not truthiness) so an explicit False can disable a YAML-true flag. + _strict_date_filter = self.context.get("strict_date_filter") + if _strict_date_filter is None: + _strict_date_filter = self.kwargs.get("strict_date_filter", False) + strict_date_filter: bool = bool(_strict_date_filter) if not query: self.context.response.success = False diff --git a/reme/steps/index/search_v2.py b/reme/steps/index/search_v2.py index 0ea4b2ed..bdeb91e0 100644 --- a/reme/steps/index/search_v2.py +++ b/reme/steps/index/search_v2.py @@ -118,9 +118,12 @@ class SearchV2Step(_ToolContextDedupMixin, BaseStep): expand_links_enabled: bool = bool(self.kwargs.get("expand_links", True)) max_links_per_direction: int = int(self.kwargs.get("max_links_per_direction", 10)) tool_context_id: str = (self.context.get("tool_context_id", "") or "").strip() - strict_date_filter: bool = bool( - self.context.get("strict_date_filter") or self.kwargs.get("strict_date_filter", False), - ) + # Injected value takes precedence over YAML kwargs; check existence + # (not truthiness) so an explicit False can disable a YAML-true flag. + _strict_date_filter = self.context.get("strict_date_filter") + if _strict_date_filter is None: + _strict_date_filter = self.kwargs.get("strict_date_filter", False) + strict_date_filter: bool = bool(_strict_date_filter) if not query: self.context.response.success = False @@ -302,8 +305,7 @@ class SearchV2Step(_ToolContextDedupMixin, BaseStep): response = await self.run_job("compressor", text=body, queries=queries) except Exception as exc: # pylint: disable=broad-except self.logger.warning( - f"[{self.name}] session body compression raised path={path!r} " - f"error={exc!r}; keeping original", + f"[{self.name}] session body compression raised path={path!r} " f"error={exc!r}; keeping original", ) return compressed = str(response.answer or "").strip()