Fix: Update system instruction when GEMINI.md memory is loaded or refreshed (#12136)

This commit is contained in:
lifefloating
2025-11-20 21:22:06 +08:00
committed by GitHub
parent 049a299b92
commit 1d2e27a698
4 changed files with 26 additions and 0 deletions

View File

@@ -182,6 +182,9 @@ describe('memoryCommand', () => {
include: [],
}),
isTrustedFolder: () => false,
updateSystemInstructionIfInitialized: vi
.fn()
.mockResolvedValue(undefined),
};
mockContext = createMockCommandContext({

View File

@@ -86,6 +86,8 @@ export const memoryCommand: SlashCommand = {
const { memoryContent, fileCount } =
await refreshServerHierarchicalMemory(config);
await config.updateSystemInstructionIfInitialized();
const successMessage =
memoryContent.length > 0
? `Memory refreshed successfully. Loaded ${memoryContent.length} characters from ${fileCount} file(s).`