fix(v13): FIX-06 PersistentMemoryStore 全量移除 — 665行死代码清理
Some checks failed
CI / Lint & TypeCheck (push) Has been cancelled
CI / Unit Tests (push) Has been cancelled
CI / Build Frontend (push) Has been cancelled
CI / Rust Check (push) Has been cancelled
CI / Security Scan (push) Has been cancelled
CI / E2E Tests (push) Has been cancelled

- persistent.rs 611→57行: 移除 PersistentMemoryStore struct + 全部方法 + 死 embedding global
- memory_commands.rs: MemoryStoreState→Arc<Mutex<()>>, memory_init→no-op, 移除 2 @reserved 命令
- viking_commands.rs: 移除冗余 PersistentMemoryStore embedding 配置段
- lib.rs: Tauri 命令 191→189 (移除 memory_configure_embedding + memory_is_embedding_configured)
- TRUTH.md + wiki/log.md 数字同步

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
iven
2026-04-13 20:58:54 +08:00
parent fd3e7fd2cb
commit 0903a0d652
7 changed files with 41 additions and 665 deletions

View File

@@ -561,7 +561,7 @@ fn parse_uri(uri: &str) -> Result<(String, MemoryType, String), String> {
}
/// Configure embedding for semantic memory search
/// Configures both SqliteStorage (VikingPanel) and PersistentMemoryStore (chat flow)
/// Configures SqliteStorage (VikingStorage) embedding for FTS5 + semantic search.
// @connected
#[tauri::command]
pub async fn viking_configure_embedding(
@@ -572,12 +572,11 @@ pub async fn viking_configure_embedding(
) -> Result<EmbeddingConfigResult, String> {
let storage = get_storage().await?;
// 1. Configure SqliteStorage (VikingPanel / VikingCommands)
let config_viking = crate::llm::EmbeddingConfig {
provider: provider.clone(),
api_key: api_key.clone(),
endpoint: endpoint.clone(),
model: model.clone(),
api_key,
endpoint,
model,
};
let client_viking = crate::llm::EmbeddingClient::new(config_viking);
@@ -588,30 +587,7 @@ pub async fn viking_configure_embedding(
.await
.map_err(|e| format!("Failed to configure embedding: {}", e))?;
// 2. Configure PersistentMemoryStore (chat flow)
let config_memory = crate::llm::EmbeddingConfig {
provider: provider.clone(),
api_key,
endpoint,
model,
};
let client_memory = std::sync::Arc::new(crate::llm::EmbeddingClient::new(config_memory));
let embed_fn: crate::memory::EmbedFn = {
let client_arc = client_memory.clone();
std::sync::Arc::new(move |text: &str| {
let client = client_arc.clone();
let text = text.to_string();
Box::pin(async move {
let response = client.embed(&text).await?;
Ok(response.embedding)
})
})
};
crate::memory::configure_embedding_client(embed_fn);
tracing::info!("[VikingCommands] Embedding configured with provider: {} (both storage systems)", provider);
tracing::info!("[VikingCommands] Embedding configured with provider: {}", provider);
Ok(EmbeddingConfigResult {
provider,