mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-07-14 03:50:49 -07:00
feat(core): add project-level memory scope to save_memory tool (#24161)
This commit is contained in:
@@ -17,6 +17,7 @@ vi.mock('../utils/memoryDiscovery.js', async (importOriginal) => {
|
||||
return {
|
||||
...actual,
|
||||
getGlobalMemoryPaths: vi.fn(),
|
||||
getUserProjectMemoryPaths: vi.fn(),
|
||||
getExtensionMemoryPaths: vi.fn(),
|
||||
getEnvironmentMemoryPaths: vi.fn(),
|
||||
readGeminiMdFiles: vi.fn(),
|
||||
@@ -47,12 +48,18 @@ describe('ContextManager', () => {
|
||||
}),
|
||||
isTrustedFolder: vi.fn().mockReturnValue(true),
|
||||
getMemoryBoundaryMarkers: vi.fn().mockReturnValue(['.git']),
|
||||
storage: {
|
||||
getProjectMemoryDir: vi
|
||||
.fn()
|
||||
.mockReturnValue('/home/user/.gemini/memory/test-project'),
|
||||
},
|
||||
} as unknown as Config;
|
||||
|
||||
contextManager = new ContextManager(mockConfig);
|
||||
vi.clearAllMocks();
|
||||
vi.spyOn(coreEvents, 'emit');
|
||||
vi.mocked(memoryDiscovery.getExtensionMemoryPaths).mockReturnValue([]);
|
||||
vi.mocked(memoryDiscovery.getUserProjectMemoryPaths).mockResolvedValue([]);
|
||||
// default mock: deduplication returns paths as-is (no deduplication)
|
||||
vi.mocked(
|
||||
memoryDiscovery.deduplicatePathsByFileIdentity,
|
||||
|
||||
Reference in New Issue
Block a user