From 0f0c3a076f515739e0d7f0de7af4825b9a47a7be Mon Sep 17 00:00:00 2001 From: Yiorgis Gozadinos Date: Mon, 26 Jan 2026 11:10:31 +0200 Subject: [PATCH] minor fixes --- haiku_rag_slim/haiku/rag/agents/chat/agent.py | 2 -- haiku_rag_slim/haiku/rag/agents/chat/context.py | 9 +-------- tests/agents/research/test_plan_prompt_selection.py | 9 +-------- 3 files changed, 2 insertions(+), 18 deletions(-) diff --git a/haiku_rag_slim/haiku/rag/agents/chat/agent.py b/haiku_rag_slim/haiku/rag/agents/chat/agent.py index f039a663..d537935b 100644 --- a/haiku_rag_slim/haiku/rag/agents/chat/agent.py +++ b/haiku_rag_slim/haiku/rag/agents/chat/agent.py @@ -41,8 +41,6 @@ async def _update_context_background( ) except asyncio.CancelledError: pass - except Exception: - pass def create_chat_agent(config: AppConfig) -> Agent[ChatDeps, str]: diff --git a/haiku_rag_slim/haiku/rag/agents/chat/context.py b/haiku_rag_slim/haiku/rag/agents/chat/context.py index a56f1aa8..5411a95a 100644 --- a/haiku_rag_slim/haiku/rag/agents/chat/context.py +++ b/haiku_rag_slim/haiku/rag/agents/chat/context.py @@ -31,14 +31,7 @@ def cache_session_context(session_id: str, context: SessionContext) -> None: def get_cached_session_context(session_id: str) -> SessionContext | None: - """Get session context from server cache. - - Args: - session_id: The session identifier. - - Returns: - Cached SessionContext, or None if not cached. - """ + """Get session context from server cache.""" _cleanup_stale_cache() return _session_context_cache.get(session_id) diff --git a/tests/agents/research/test_plan_prompt_selection.py b/tests/agents/research/test_plan_prompt_selection.py index b074a3d2..695feec6 100644 --- a/tests/agents/research/test_plan_prompt_selection.py +++ b/tests/agents/research/test_plan_prompt_selection.py @@ -15,21 +15,14 @@ def test_plan_prompt_instructs_gather_context(): def test_prompt_selection_uses_context_prompt_with_session_context(): - """When session_context exists, should use PLAN_PROMPT_WITH_CONTEXT. - - This tests the logic pattern used in _plan_step_logic. - """ - # Simulate the selection logic from graph.py + """When session_context exists, should use PLAN_PROMPT_WITH_CONTEXT.""" has_prior_answers = False has_session_context = True - # Current buggy behavior would select plan_prompt (the one with gather_context) - # Expected behavior: use PLAN_PROMPT_WITH_CONTEXT when session_context exists effective_plan_prompt = ( PLAN_PROMPT_WITH_CONTEXT if has_prior_answers or has_session_context else PLAN_PROMPT ) - # Since session_context exists, we should use PLAN_PROMPT_WITH_CONTEXT assert effective_plan_prompt == PLAN_PROMPT_WITH_CONTEXT