mirror of
https://github.com/samvallad33/vestige.git
synced 2026-05-09 07:42:37 +02:00
fix: add explicit embedding initialization with error logging
When embeddings fail to initialize in the MCP server context (e.g., due to working directory issues), the error was silently swallowed and smart_ingest would fall back to regular ingest without explanation. Changes: - Add init_embeddings() method to Storage for explicit initialization - Initialize embeddings at MCP server startup with error logging - Add check_ready() method to EmbeddingService for error access - Log warning when is_ready() returns false Now users will see clear error messages like: "Failed to initialize embedding service: ..." "Hint: Check FASTEMBED_CACHE_PATH or ensure ~/.fastembed_cache exists" Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
6ccbc7d2c0
commit
f10367ecd0
3 changed files with 40 additions and 2 deletions
|
|
@ -133,8 +133,21 @@ async fn main() {
|
|||
|
||||
// Initialize storage with optional custom data directory
|
||||
let storage = match Storage::new(data_dir) {
|
||||
Ok(s) => {
|
||||
Ok(mut s) => {
|
||||
info!("Storage initialized successfully");
|
||||
|
||||
// Try to initialize embeddings early and log any issues
|
||||
#[cfg(feature = "embeddings")]
|
||||
{
|
||||
if let Err(e) = s.init_embeddings() {
|
||||
error!("Failed to initialize embedding service: {}", e);
|
||||
error!("Smart ingest will fall back to regular ingest without deduplication");
|
||||
error!("Hint: Check FASTEMBED_CACHE_PATH or ensure ~/.fastembed_cache exists");
|
||||
} else {
|
||||
info!("Embedding service initialized successfully");
|
||||
}
|
||||
}
|
||||
|
||||
Arc::new(Mutex::new(s))
|
||||
}
|
||||
Err(e) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue