Skip to content
Closed
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions packages/cli/src/config/extension-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -481,10 +481,19 @@ Would you like to attempt to install via "git clone" instead?`,
if (!fs.existsSync(extensionsDir)) {
return this.loadedExtensions;
}

// Load extensions sequentially (refactored to prepare for parallelization)
for (const subdir of fs.readdirSync(extensionsDir)) {
const extensionDir = path.join(extensionsDir, subdir);
Comment thread
Vivekgupta008 marked this conversation as resolved.
Outdated
await this.loadExtension(extensionDir);
const extension = await this.loadExtension(extensionDir);

// Only add successfully loaded extensions to the array
if (extension !== null) {
this.loadedExtensions = [...this.loadedExtensions, extension];
await this.maybeStartExtension(extension);
}
}

return this.loadedExtensions;
}

Expand Down Expand Up @@ -633,9 +642,12 @@ Would you like to attempt to install via "git clone" instead?`,
resolvedSettings,
skills,
};
this.loadedExtensions = [...this.loadedExtensions, extension];

await this.maybeStartExtension(extension);
// NOTE: Caller (loadExtensions) is now responsible for:
Comment thread
Vivekgupta008 marked this conversation as resolved.
Outdated
// - Adding extension to this.loadedExtensions array
// - Calling this.maybeStartExtension(extension)
// This separation allows for parallel loading in the future.

return extension;
} catch (e) {
debugLogger.error(
Expand Down