Skip to content

Fix/journal service embedder wiring#52

Merged
asiniscalchi merged 2 commits into
mainfrom
fix/journal-service-embedder-wiring
May 3, 2026
Merged

Fix/journal service embedder wiring#52
asiniscalchi merged 2 commits into
mainfrom
fix/journal-service-embedder-wiring

Conversation

@asiniscalchi

Copy link
Copy Markdown
Owner

No description provided.

asiniscalchi and others added 2 commits May 3, 2026 03:36
Previously the journal service builder chained three RigOpenAiEmbedder::from_env
calls inside an `if let ... && let Ok(_) && let Ok(_) && let Ok(_)`, so any one
construction failure silently disabled the entire search subsystem with no log
message. Construct the embedder once, log a warning on failure, and propagate
the error via `?` to match spawn_embedding_worker / spawn_daily_review_embedding_worker.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…sitory

The journal service builder constructed three SemanticSearchService /
SemanticDailyReviewSearchService / ImmediateCaptureEmbeddingService instances,
each owning its own RigOpenAiEmbedder (and therefore its own OpenAI client).
Add a blanket `impl<E: Embedder + ?Sized> Embedder for Arc<E>` so the embedder
can be wrapped in an Arc once and shared across the three builders without
changing their generic signatures, then use Arc::clone on the call site.

Also build SqliteEmbeddingRepository once and Clone it for the search index,
capture index, and pending-embedding counter rather than constructing three
separate instances from pool.clone().

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@asiniscalchi asiniscalchi force-pushed the fix/journal-service-embedder-wiring branch from f72eb9c to d904433 Compare May 3, 2026 03:36
@asiniscalchi asiniscalchi merged commit 7d45c25 into main May 3, 2026
3 checks passed
@asiniscalchi asiniscalchi deleted the fix/journal-service-embedder-wiring branch May 3, 2026 03:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant