The all-in-one local AI studio for your desktop: chat, image and video generation and a coding agent in one free, open source app. Windows and Linux. No Docker, no terminal, no cloud required.
TypeScript agentai-chatai-studioall-in-onecoding-agentdesktop-appfluximage-generationlinuxllmlocal-ailocal-llmopen-sourceprivacyself-hostedstable-diffusionuncensoreduncensored-aivideo-generationwindows
fix(memory): UPDATE-Zusammenfuehrung ohne Kandidat schlug fehl (R2-36)
purple5d31ebab429d
diff --git a/src/stores/__tests__/memory-scope.test.ts b/src/stores/__tests__/memory-scope.test.tsindex 0b2e4aef..0c2c26d7 100644--- a/src/stores/__tests__/memory-scope.test.ts+++ b/src/stores/__tests__/memory-scope.test.ts@@ -46,6 +46,12 @@ it('rejects cross-project automatic merges and accepts matching scopes', () => {useMemoryStore.getState().applyWriteDecision(decision, { newId })expect(useMemoryStore.getState().entries[0].content).toBe('Merged fixture')})+it('R2-36: an UPDATE without a candidate still merges (no ctx.newId to compare scope against)', () => {+ const targetId = add('A')+ const decision = { action: 'UPDATE' as const, targetId, mergedContent: 'Merged fixture' }+ useMemoryStore.getState().applyWriteDecision(decision)+ expect(useMemoryStore.getState().entries[0].content).toBe('Merged fixture')+})it('pins the requested scope across asynchronous fallback', async () => {add('A', 'Alpha fixture')add('B', 'Beta fixture')diff --git a/src/stores/memoryStore.ts b/src/stores/memoryStore.tsindex 5e489647..ccbb5985 100644--- a/src/stores/memoryStore.ts+++ b/src/stores/memoryStore.ts@@ -950,7 +950,11 @@ export const useMemoryStore = create<MemoryState>()(const target = get().entries.find((e) => e.id === targetId)if (!target || target.sensitive) returnconst candidate = ctx?.newId ? get().entries.find(e => e.id === ctx.newId) : undefined- if (target.scope !== candidate?.scope) return+ // R2-36: `target.scope !== candidate?.scope` returned true whenever+ // there was no candidate at all (candidate?.scope undefined, target.scope+ // set), so an UPDATE without ctx.newId never applied. The scope check+ // only makes sense when there IS a candidate to compare against.+ if (candidate && target.scope !== candidate.scope) returnconst merged = mergedContent.trim()if (!merged) return