From 4946ea16681301f6635dde088466ac6f871135a6 Mon Sep 17 00:00:00 2001 From: Debanjum Date: Wed, 11 Jun 2025 10:43:17 -0700 Subject: [PATCH] Fix to save organic results to conversation context in DB This bug was introduced in 05d4e19cb, version 1.42.2, during migration to save deeply typed ChatMessageModel. As the ChatMessageModel did not use the right field name for organic results (since the start). Previously it did not matter as it was storing to DB irrespective but now the mapping of dictionary to ChatMessageModel drops that field before save to conversation in DB. This was resulting in organic context being lost on page reload and only being shown on first response. --- src/khoj/database/models/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/khoj/database/models/__init__.py b/src/khoj/database/models/__init__.py index c4ccadbf..f6518188 100644 --- a/src/khoj/database/models/__init__.py +++ b/src/khoj/database/models/__init__.py @@ -85,7 +85,7 @@ class OnlineContext(PydanticBaseModel): answerBox: Optional[AnswerBox] = None peopleAlsoAsk: Optional[List[PeopleAlsoAsk]] = None knowledgeGraph: Optional[KnowledgeGraph] = None - organicContext: Optional[List[OrganicContext]] = None + organic: Optional[List[OrganicContext]] = None class Intent(PydanticBaseModel):