Skip to content

Commit 720ff7b

Browse files
committed
add logging to debug broken conversation error
1 parent 39233d1 commit 720ff7b

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

backend/oasst_backend/prompt_repository.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -767,6 +767,9 @@ def trace_conversation(messages: list[Message] | dict[UUID, Message], last_messa
767767
while conv[-1].parent_id:
768768
if conv[-1].parent_id not in messages:
769769
# Can't form a continuous conversation
770+
logger.error(
771+
f"Broken conversation: parent of message (id={conv[-1].id}, parent_id={conv[-1].parent_id}) not found in result set"
772+
)
770773
raise OasstError(
771774
"Broken conversation", OasstErrorCode.BROKEN_CONVERSATION, HTTPStatus.INTERNAL_SERVER_ERROR
772775
)

0 commit comments

Comments
 (0)