Skip to content

Commit dcc4a7a

Browse files
groksrcclaude
andcommitted
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>
1 parent 2029991 commit dcc4a7a

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

tests/repository/test_entity_boost_search_service.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,15 +105,14 @@ async def _build_search_service(
105105
embedding_provider=provider,
106106
)
107107
else:
108+
# Pass the stub provider at construction time so __init__ does not
109+
# instantiate the real configured provider when semantic_search_enabled=True.
108110
repo = SQLiteSearchRepository(
109111
session_maker,
110112
project_id=test_project.id,
111113
app_config=app_config,
114+
embedding_provider=provider,
112115
)
113-
repo._semantic_enabled = True
114-
repo._embedding_provider = provider
115-
repo._vector_dimensions = provider.dimensions
116-
repo._vector_tables_initialized = False
117116
search_repo = repo
118117

119118
service = SearchService(search_repo, entity_repository, file_service)

0 commit comments

Comments
 (0)