fix(channels): use platform message IDs to prevent duplicate memories

Fixes #430 - Prevents duplicate memories after restart by using platform message IDs instead of random UUIDs.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Argenis 2026-02-16 19:04:37 -05:00 committed by GitHub
parent c3cc835346
commit e8553a800a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 217 additions and 82 deletions

View file

@ -76,7 +76,10 @@ pub fn create_memory(
// Auto-hydration: if brain.db is missing but MEMORY_SNAPSHOT.md exists,
// restore the "soul" from the snapshot before creating the backend.
if config.auto_hydrate
&& matches!(classify_memory_backend(&config.backend), MemoryBackendKind::Sqlite | MemoryBackendKind::Lucid)
&& matches!(
classify_memory_backend(&config.backend),
MemoryBackendKind::Sqlite | MemoryBackendKind::Lucid
)
&& snapshot::should_hydrate(workspace_dir)
{
tracing::info!("🧬 Cold boot detected — hydrating from MEMORY_SNAPSHOT.md");
@ -143,10 +146,7 @@ pub fn create_memory_for_migration(
}
/// Factory: create an optional response cache from config.
pub fn create_response_cache(
config: &MemoryConfig,
workspace_dir: &Path,
) -> Option<ResponseCache> {
pub fn create_response_cache(config: &MemoryConfig, workspace_dir: &Path) -> Option<ResponseCache> {
if !config.response_cache_enabled {
return None;
}