Skip to content

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.

fix(speicher): getMemoryForPrompt geloescht, es gab nur Tests als Aufrufer

purple100aef9d42da
diff --git a/src/lib/__tests__/memory-e2e.test.ts b/src/lib/__tests__/memory-e2e.test.ts
index 5f11a29e..9a82c48d 100644
--- a/src/lib/__tests__/memory-e2e.test.ts
+++ b/src/lib/__tests__/memory-e2e.test.ts
@@ -342,12 +342,6 @@ describe('Legacy addEntry Compat', () => {
useMemoryStore.getState().addEntry('fact', 'Test', 'agent:web_search')
expect(useMemoryStore.getState().entries[0].tags).toContain('agent:web_search')
})
-
- it('legacy getMemoryForPrompt still works', () => {
- useMemoryStore.getState().addEntry('fact', 'Rememberable fact about TypeScript')
- const prompt = useMemoryStore.getState().getMemoryForPrompt('TypeScript')
- expect(prompt).toContain('TypeScript')
- })
})
// ── v1 → v2 Migration ─────────────────────────────────────────
diff --git a/src/stores/__tests__/stores.test.ts b/src/stores/__tests__/stores.test.ts
index d0df4072..c15a4b31 100644
--- a/src/stores/__tests__/stores.test.ts
+++ b/src/stores/__tests__/stores.test.ts
@@ -590,19 +590,6 @@ describe('memoryStore', () => {
})
})
- describe('getMemoryForPrompt (legacy compat)', () => {
- it('returns formatted string via legacy API', () => {
- useMemoryStore.getState().addEntry('fact', 'Earth orbits the Sun')
- const prompt = useMemoryStore.getState().getMemoryForPrompt('Earth Sun')
- expect(prompt).toContain('Earth orbits the Sun')
- })
-
- it('returns empty for no matches', () => {
- const prompt = useMemoryStore.getState().getMemoryForPrompt('xylophone')
- expect(prompt).toBe('')
- })
- })
-
describe('exportAsMarkdown', () => {
it('returns placeholder when no entries exist', () => {
const md = useMemoryStore.getState().exportAsMarkdown()
diff --git a/src/stores/memoryStore.ts b/src/stores/memoryStore.ts
index a4ebd20f..18f6929d 100644
--- a/src/stores/memoryStore.ts
+++ b/src/stores/memoryStore.ts
@@ -363,7 +363,6 @@ interface MemoryState {
// Legacy compat (used by old code paths during transition)
addEntry: (category: MemoryCategory, content: string, source?: string) => void
- getMemoryForPrompt: (query: string, maxChars?: number) => string
}
// ── Migration from v1 (old MemoryEntry[]) to v2 (MemoryFile[]) ──
@@ -1142,15 +1141,6 @@ export const useMemoryStore = create<MemoryState>()(
source: source || 'agent',
})
},
-
- getMemoryForPrompt: (query, maxChars = 2000) => {
- // Legacy: the current API budgets in context TOKENS, so the 8K
- // assumption stays. The caller's character cap used to be accepted and
- // then silently dropped, which is the one thing this signature
- // promises; it is honoured on the rendered block instead.
- const block = get().getMemoriesForPrompt(query, 8192)
- return block.length > maxChars ? block.slice(0, maxChars) : block
- },
}),
{
name: 'locally-uncensored-memory',