summaryrefslogtreecommitdiff
path: root/packages/cli/src/ui/commands/memoryCommand.ts
diff options
context:
space:
mode:
authorBrandon Keiji <[email protected]>2025-07-23 14:48:35 -0700
committerGitHub <[email protected]>2025-07-23 21:48:35 +0000
commitd7a304bcffc7d2340f3de762f14286596954ce4e (patch)
tree6625f9cf3f3c560a595f2f232292c22499276660 /packages/cli/src/ui/commands/memoryCommand.ts
parent9d3164621a8bb0e2bbf8d2309fba1d8678c0abe2 (diff)
feat(memory): make directory search limit on memory discovery configurable with settings.json (#4460)
Diffstat (limited to 'packages/cli/src/ui/commands/memoryCommand.ts')
-rw-r--r--packages/cli/src/ui/commands/memoryCommand.ts21
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).`