fix(codex): wait for curated migration marketplace

This commit is contained in:
Vincent Koc
2026-05-16 13:00:00 +08:00
committed by Peter Steinberger
parent 2e3c1bbd2f
commit cb88c7d832
2 changed files with 9 additions and 5 deletions
+2 -1
View File
@@ -29,6 +29,7 @@ import {
resolveCodexAppServerFallbackApiKeyCacheKey,
} from "../app-server/auth-bridge.js";
import {
CODEX_PLUGINS_MARKETPLACE_NAME,
isCodexPluginsMarketplaceName,
readCodexPluginConfig,
resolveCodexAppServerRuntimeOptions,
@@ -359,7 +360,7 @@ function hasOpenAiCuratedMarketplace(response: unknown): boolean {
return false;
}
const name = (marketplace as { name?: unknown }).name;
return typeof name === "string" && isCodexPluginsMarketplaceName(name);
return name === CODEX_PLUGINS_MARKETPLACE_NAME;
})
);
}
@@ -1462,7 +1462,7 @@ describe("buildCodexMigrationProvider", () => {
if (method === "plugin/list" && isTarget) {
targetPluginListCalls += 1;
if (targetPluginListCalls === 1) {
return { marketplaces: [], marketplaceLoadErrors: [], featuredPluginIds: [] };
return pluginList([], "openai-bundled");
}
return pluginList([pluginSummary("google-calendar", { installed: true, enabled: true })]);
}
@@ -2225,12 +2225,15 @@ function createConfigRuntime(
} as unknown as MigrationProviderContext["runtime"];
}
function pluginList(plugins: v2.PluginSummary[]): v2.PluginListResponse {
function pluginList(
plugins: v2.PluginSummary[],
marketplaceName = CODEX_PLUGINS_MARKETPLACE_NAME,
): v2.PluginListResponse {
return {
marketplaces: [
{
name: CODEX_PLUGINS_MARKETPLACE_NAME,
path: "/marketplaces/openai-curated",
name: marketplaceName,
path: `/marketplaces/${marketplaceName}`,
interface: null,
plugins,
},