fix: handle missing local extension config and skip hooks when disabled (#14744)

This commit is contained in:
Abhi
2025-12-08 20:51:42 -05:00
committed by GitHub
parent 8f43d4851d
commit d35a1fdec7
4 changed files with 83 additions and 9 deletions
+7 -4
View File
@@ -514,10 +514,13 @@ export class ExtensionManager extends ExtensionLoader {
)
.filter((contextFilePath) => fs.existsSync(contextFilePath));
const hooks = await this.loadExtensionHooks(effectiveExtensionPath, {
extensionPath: effectiveExtensionPath,
workspacePath: this.workspaceDir,
});
let hooks: { [K in HookEventName]?: HookDefinition[] } | undefined;
if (this.settings.tools?.enableHooks) {
hooks = await this.loadExtensionHooks(effectiveExtensionPath, {
extensionPath: effectiveExtensionPath,
workspacePath: this.workspaceDir,
});
}
const extension = {
name: config.name,