Refresh hooks when refreshing extensions. (#14918)

This commit is contained in:
Tommaso Sciortino
2025-12-12 16:43:46 -08:00
committed by GitHub
parent 977248e095
commit 126c32aca4
9 changed files with 26 additions and 107 deletions
+7 -8
View File
@@ -111,6 +111,7 @@ export abstract class ExtensionLoader {
// reload memory, this is somewhat expensive and also busts the context
// cache, we want to only do it once.
await refreshServerHierarchicalMemory(this.config);
await this.config.getHookSystem()?.initialize();
}
}
@@ -134,13 +135,12 @@ export abstract class ExtensionLoader {
* then calls `startExtension` to include all extension features into the
* program.
*/
protected maybeStartExtension(
protected async maybeStartExtension(
extension: GeminiCLIExtension,
): Promise<void> | undefined {
): Promise<void> {
if (this.config && this.config.getEnableExtensionReloading()) {
return this.startExtension(extension);
await this.startExtension(extension);
}
return;
}
/**
@@ -192,13 +192,12 @@ export abstract class ExtensionLoader {
* then this also performs all necessary steps to remove all extension
* features from the rest of the system.
*/
protected maybeStopExtension(
protected async maybeStopExtension(
extension: GeminiCLIExtension,
): Promise<void> | undefined {
): Promise<void> {
if (this.config && this.config.getEnableExtensionReloading()) {
return this.stopExtension(extension);
await this.stopExtension(extension);
}
return;
}
async restartExtension(extension: GeminiCLIExtension): Promise<void> {