fix(desktop): sidebar tab animation + memory deduplication
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
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
1. Fix sidebar tab switching: replace containerVariants (staggerChildren without motion children) with simple fade variants. The previous staggerChildren:0.05 caused the container to stay at opacity:0 when switching to CloneManager because non-motion children couldn't participate in stagger animation. 2. Fix memory deduplication: add content+agentId based dedup check in fallbackMemory.store(). Previously same content was stored 4x with different IDs. Now updates importance/accessCount instead.
This commit is contained in:
@@ -46,6 +46,27 @@ export const fallbackMemory = {
|
||||
|
||||
async store(entry: MemoryEntryInput): Promise<string> {
|
||||
const store = getFallbackStore();
|
||||
|
||||
// Content-based deduplication: update existing entry with same agentId + content
|
||||
const normalizedContent = entry.content.trim().toLowerCase();
|
||||
const existingIdx = store.memories.findIndex(
|
||||
m => m.agentId === entry.agent_id && m.content.trim().toLowerCase() === normalizedContent
|
||||
);
|
||||
|
||||
if (existingIdx >= 0) {
|
||||
// Update existing entry instead of creating duplicate
|
||||
const existing = store.memories[existingIdx];
|
||||
store.memories[existingIdx] = {
|
||||
...existing,
|
||||
importance: Math.max(existing.importance, entry.importance ?? 5),
|
||||
lastAccessedAt: new Date().toISOString(),
|
||||
accessCount: existing.accessCount + 1,
|
||||
tags: [...new Set([...existing.tags, ...(entry.tags ?? [])])],
|
||||
};
|
||||
saveFallbackStore(store);
|
||||
return existing.id;
|
||||
}
|
||||
|
||||
const id = `mem_${Date.now()}_${generateRandomString(6)}`;
|
||||
const now = new Date().toISOString();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user