Skip to content

Commit 16e09a4

Browse files
committed
fix: clone marketplace before auto-installing plugin when manifest not found
When auto-installing a plugin from a marketplace that hasn't been cloned yet, loadMarketplaceManifest throws because the manifest file doesn't exist. The empty catch block previously just fell through to installPlugin, which would fail with the same error. Now the catch block attempts to clone/update the marketplace before falling through, so installPlugin can succeed.
1 parent 1717249 commit 16e09a4

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

packages/agent-sdk/src/managers/pluginManager.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,14 @@ export class PluginManager {
138138
continue;
139139
}
140140
} catch {
141-
// Manifest read failed (marketplace not cloned yet?) — fall through to installPlugin
141+
// Manifest read failed — marketplace may not be cloned yet, try to clone/update it
142+
try {
143+
await marketplaceService.updateMarketplace(marketplaceName);
144+
} catch (updateError) {
145+
logger?.warn(
146+
`Failed to clone/update marketplace ${marketplaceName}: ${updateError instanceof Error ? updateError.message : String(updateError)}`,
147+
);
148+
}
142149
}
143150

144151
logger?.info(`Auto-installing missing plugin: ${pluginId}`);

0 commit comments

Comments
 (0)