fix(plugins): refresh gateway marketplace catalog (#117724)

This commit is contained in:
Peter Steinberger
2026-08-01 18:24:08 -07:00
committed by GitHub
parent a789b323ab
commit 75e815e866
2 changed files with 88 additions and 0 deletions
+16
View File
@@ -776,6 +776,9 @@ function formatPinnedMarketplaceRefreshFailure(payload: MarketplaceRefreshPayloa
return `Pinned marketplace feed refresh did not accept a fresh hosted payload (source: ${payload.source}).`;
}
const MARKETPLACE_GATEWAY_RESTART_GUIDANCE =
'The running Gateway could not refresh its marketplace catalog. Run "openclaw gateway restart" to apply the current catalog state.';
/** List entries from the configured OpenClaw marketplace feed. */
export async function runPluginMarketplaceEntriesCommand(
opts: PluginMarketplaceEntriesOptions,
@@ -851,6 +854,13 @@ export async function runPluginMarketplaceRefreshCommand(
const { clearManagedPluginOfficialCatalogCache } =
await import("../plugins/management-service.js");
clearManagedPluginOfficialCatalogCache();
let gatewayRefreshed = true;
// Reused snapshots can lose install authority as they age, so their Gateway projection is stale too.
if (result.source !== "bundled-fallback") {
const { notifyGatewayPluginMetadataChanged } =
await import("./plugins-update-gateway-signal.js");
gatewayRefreshed = await notifyGatewayPluginMetadataChanged(cfg);
}
const payload = sanitizeMarketplaceRefreshPayload(buildMarketplaceRefreshPayload(result), {
feedUrl: opts.feedUrl,
});
@@ -869,6 +879,9 @@ export async function runPluginMarketplaceRefreshCommand(
if (opts.json) {
defaultRuntime.writeJson(payload);
if (!gatewayRefreshed) {
defaultRuntime.error(MARKETPLACE_GATEWAY_RESTART_GUIDANCE);
}
if (failedPinnedRefresh) {
defaultRuntime.error(formatPinnedMarketplaceRefreshFailure(payload));
return defaultRuntime.exit(1);
@@ -877,6 +890,9 @@ export async function runPluginMarketplaceRefreshCommand(
}
const lines = formatMarketplaceFeedLines(payload, { includeChecksum: true });
if (!gatewayRefreshed) {
lines.push("", theme.warn(MARKETPLACE_GATEWAY_RESTART_GUIDANCE));
}
defaultRuntime.log(lines.join("\n"));
if (failedPinnedRefresh) {
defaultRuntime.error(formatPinnedMarketplaceRefreshFailure(payload));