From 9935d4db0b04b379ed20ccbde7936b03c5bea765 Mon Sep 17 00:00:00 2001 From: Debanjum Date: Mon, 28 Oct 2024 17:48:45 -0700 Subject: [PATCH] Do not use a message branch if no msg id provided to prompt tracer --- src/khoj/processor/conversation/utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/khoj/processor/conversation/utils.py b/src/khoj/processor/conversation/utils.py index 7c46b3b3..184de372 100644 --- a/src/khoj/processor/conversation/utils.py +++ b/src/khoj/processor/conversation/utils.py @@ -423,7 +423,8 @@ def commit_conversation_trace( msg_branch = f"m_{mid}" if mid else None if msg_branch and msg_branch not in repo.branches: repo.create_head(msg_branch) - repo.heads[msg_branch].checkout() + if msg_branch: + repo.heads[msg_branch].checkout() # Include file with content to commit files_to_commit = {"query": session_yaml, "response": response_yaml, "system_prompt": system_message_yaml}