From 598e243fd292dd8851865ab1c3915ca55f4992cc Mon Sep 17 00:00:00 2001 From: Nate Sesti Date: Wed, 23 Aug 2023 16:52:07 -0700 Subject: fix: :bug: fix meilisearch empty body content-type bug --- continuedev/src/continuedev/core/context.py | 2 +- continuedev/src/continuedev/plugins/context_providers/file.py | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/continuedev/src/continuedev/core/context.py b/continuedev/src/continuedev/core/context.py index d47ad942..e6642404 100644 --- a/continuedev/src/continuedev/core/context.py +++ b/continuedev/src/continuedev/core/context.py @@ -251,7 +251,7 @@ class ContextManager: async def add_docs(): index = await search_client.get_index(SEARCH_INDEX_NAME) - await index.add_documents(documents) + await index.add_documents(documents or []) await asyncio.wait_for(add_docs(), timeout=5) diff --git a/continuedev/src/continuedev/plugins/context_providers/file.py b/continuedev/src/continuedev/plugins/context_providers/file.py index 3cb63ca3..f4e6e374 100644 --- a/continuedev/src/continuedev/plugins/context_providers/file.py +++ b/continuedev/src/continuedev/plugins/context_providers/file.py @@ -77,6 +77,9 @@ class FileContextProvider(ContextProvider): await self.delete_documents(ids) async def on_files_renamed(old_filepaths: List[str], new_filepaths: List[str]): + if self.sdk.ide.workspace_directory is None: + return + old_ids = [self.get_id_for_filepath(filepath) for filepath in old_filepaths] new_docs = await asyncio.gather( *[ -- cgit v1.2.3-70-g09d2