From dcc5073d166de2ff4054b746a5719eb7e408bee8 Mon Sep 17 00:00:00 2001 From: Debanjum Date: Fri, 20 Dec 2024 13:27:29 -0800 Subject: [PATCH] Fix the to_notify decider automation chat actor. Add detailed logging --- src/khoj/routers/helpers.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/khoj/routers/helpers.py b/src/khoj/routers/helpers.py index 4e458651..5b6825c4 100644 --- a/src/khoj/routers/helpers.py +++ b/src/khoj/routers/helpers.py @@ -1651,12 +1651,15 @@ def should_notify(original_query: str, executed_query: str, ai_response: str, us with timer("Chat actor: Decide to notify user of automation response", logger): try: # TODO Replace with async call so we don't have to maintain a sync version - response = send_message_to_model_wrapper_sync(to_notify_or_not, user) + response = send_message_to_model_wrapper_sync(to_notify_or_not, user=user) should_notify_result = "no" not in response.lower() logger.info(f'Decided to {"not " if not should_notify_result else ""}notify user of automation response.') return should_notify_result - except: - logger.warning(f"Fallback to notify user of automation response as failed to infer should notify or not.") + except Exception as e: + logger.warning( + f"Fallback to notify user of automation response as failed to infer should notify or not. {e}", + exc_info=True, + ) return True