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 <noreply@anthropic.com>
Signed-off-by: Drew Cain <groksrc@gmail.com>
This commit is contained in:
Drew Cain
2026-06-11 09:36:26 -05:00
parent 9fac9a9416
commit de8eac6638
@@ -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)