From de8eac6638997ceb42a680a8cd4706d9b65deca4 Mon Sep 17 00:00:00 2001 From: Drew Cain Date: Thu, 11 Jun 2026 09:36:26 -0500 Subject: [PATCH] test(core): pass stub embedding provider to SQLiteSearchRepository at construction time On the SQLite path, SQLiteSearchRepository.__init__ calls create_embedding_provider() when semantic_search_enabled=True and no provider is supplied, which could pull FastEmbed/cache artifacts or fail where semantic deps are unusable. The Postgres branch already passed the stub provider at construction; bring the SQLite branch in line by passing embedding_provider=provider to the constructor and removing the redundant after-the-fact attribute swaps. Co-Authored-By: Claude Signed-off-by: Drew Cain --- tests/repository/test_entity_boost_search_service.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tests/repository/test_entity_boost_search_service.py b/tests/repository/test_entity_boost_search_service.py index 2426a44b..3e5d22e1 100644 --- a/tests/repository/test_entity_boost_search_service.py +++ b/tests/repository/test_entity_boost_search_service.py @@ -105,15 +105,14 @@ async def _build_search_service( embedding_provider=provider, ) else: + # Pass the stub provider at construction time so __init__ does not + # instantiate the real configured provider when semantic_search_enabled=True. repo = SQLiteSearchRepository( session_maker, project_id=test_project.id, app_config=app_config, + embedding_provider=provider, ) - repo._semantic_enabled = True - repo._embedding_provider = provider - repo._vector_dimensions = provider.dimensions - repo._vector_tables_initialized = False search_repo = repo service = SearchService(search_repo, entity_repository, file_service)