diff options
Diffstat (limited to 'packages/cli/src/ui/commands/memoryCommand.ts')
| -rw-r--r-- | packages/cli/src/ui/commands/memoryCommand.ts | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/packages/cli/src/ui/commands/memoryCommand.ts b/packages/cli/src/ui/commands/memoryCommand.ts index afa43031..fe698c0f 100644 --- a/packages/cli/src/ui/commands/memoryCommand.ts +++ b/packages/cli/src/ui/commands/memoryCommand.ts @@ -4,7 +4,10 @@ * SPDX-License-Identifier: Apache-2.0 */ -import { getErrorMessage } from '@google/gemini-cli-core'; +import { + getErrorMessage, + loadServerHierarchicalMemory, +} from '@google/gemini-cli-core'; import { MessageType } from '../types.js'; import { CommandKind, @@ -81,10 +84,20 @@ export const memoryCommand: SlashCommand = { ); try { - const result = await context.services.config?.refreshMemory(); + const config = await context.services.config; + if (config) { + const { memoryContent, fileCount } = + await loadServerHierarchicalMemory( + config.getWorkingDir(), + config.getDebugMode(), + config.getFileService(), + config.getExtensionContextFilePaths(), + config.getFileFilteringOptions(), + context.services.settings.merged.memoryDiscoveryMaxDirs, + ); + config.setUserMemory(memoryContent); + config.setGeminiMdFileCount(fileCount); - if (result) { - const { memoryContent, fileCount } = result; const successMessage = memoryContent.length > 0 ? `Memory refreshed successfully. Loaded ${memoryContent.length} characters from ${fileCount} file(s).` |
