diff --git a/src/plugins/plugin-lookup-table.test.ts b/src/plugins/plugin-lookup-table.test.ts index 8dba780a4f7..7b33431b3c3 100644 --- a/src/plugins/plugin-lookup-table.test.ts +++ b/src/plugins/plugin-lookup-table.test.ts @@ -98,7 +98,7 @@ describe("loadPluginLookUpTable", () => { createManifestRecord({ id: "openai", origin: "bundled", - providers: ["openai"], + providers: ["openai", "openai-codex"], cliBackends: ["codex-cli"], setup: { providers: [{ id: "openai" }], @@ -128,6 +128,7 @@ describe("loadPluginLookUpTable", () => { expect(table.manifestRegistry).toBe(manifestRegistry); expect(table.byPluginId.get("telegram")?.id).toBe("telegram"); + expect(table.normalizePluginId("openai-codex")).toBe("openai"); expect(table.owners.channels.get("telegram")).toEqual(["telegram"]); expect(table.owners.providers.get("openai")).toEqual(["openai"]); expect(table.owners.cliBackends.get("codex-cli")).toEqual(["openai"]); diff --git a/src/plugins/plugin-lookup-table.ts b/src/plugins/plugin-lookup-table.ts index 6d158d50f64..6c3ec1996c6 100644 --- a/src/plugins/plugin-lookup-table.ts +++ b/src/plugins/plugin-lookup-table.ts @@ -9,6 +9,7 @@ import { loadPluginManifestRegistryForInstalledIndex } from "./manifest-registry import type { PluginManifestRecord, PluginManifestRegistry } from "./manifest-registry.js"; import type { PluginDiagnostic } from "./manifest-types.js"; import { + createPluginRegistryIdNormalizer, loadPluginRegistrySnapshotWithMetadata, type PluginRegistrySnapshot, type PluginRegistrySnapshotDiagnostic, @@ -35,6 +36,7 @@ export type PluginLookUpTable = { plugins: readonly PluginManifestRecord[]; diagnostics: readonly PluginDiagnostic[]; byPluginId: ReadonlyMap; + normalizePluginId: (pluginId: string) => string; owners: PluginLookUpTableOwnerMaps; startup: PluginLookUpTableStartupPlan; }; @@ -122,6 +124,7 @@ export function loadPluginLookUpTable(params: LoadPluginLookUpTableParams): Plug index, manifestRegistry, }); + const normalizePluginId = createPluginRegistryIdNormalizer(index, { manifestRegistry }); const byPluginId = new Map(manifestRegistry.plugins.map((plugin) => [plugin.id, plugin])); const owners = buildOwnerMaps(manifestRegistry.plugins); const startup = { @@ -147,6 +150,7 @@ export function loadPluginLookUpTable(params: LoadPluginLookUpTableParams): Plug plugins: manifestRegistry.plugins, diagnostics: [...index.diagnostics, ...manifestRegistry.diagnostics], byPluginId, + normalizePluginId, owners, startup, };