Fix mcp instructions (#16439)

This commit is contained in:
christine betts
2026-01-20 11:10:21 -05:00
committed by GitHub
parent 1182168bd9
commit 166e04a8dd
3 changed files with 78 additions and 21 deletions
+18
View File
@@ -1278,6 +1278,24 @@ export class Config {
return this.userMemory;
}
/**
* Refreshes the MCP context, including memory, tools, and system instructions.
*/
async refreshMcpContext(): Promise<void> {
if (this.experimentalJitContext && this.contextManager) {
await this.contextManager.refresh();
} else {
const { refreshServerHierarchicalMemory } = await import(
'../utils/memoryDiscovery.js'
);
await refreshServerHierarchicalMemory(this);
}
if (this.geminiClient?.isInitialized()) {
await this.geminiClient.setTools();
await this.geminiClient.updateSystemInstruction();
}
}
setUserMemory(newUserMemory: string): void {
this.userMemory = newUserMemory;
}