refactor(providers): unify lifecycle-safe manifest registration (#114381)

* refactor(providers): canonicalize manifest-driven registration

* fix(zai): eliminate type-only SDK import side effects
This commit is contained in:
Peter Steinberger
2026-07-27 03:20:02 -04:00
committed by GitHub
parent 65cce37480
commit eec2c0cc26
20 changed files with 892 additions and 825 deletions

View File

@@ -44,6 +44,21 @@ describe("opencode provider plugin", () => {
beforeEach(() => {
clearLiveCatalogCacheForTests();
});
it("registers only the Zen auth choice from its own provider manifest", async () => {
const provider = await registerSingleProviderPlugin(plugin);
expect(provider.id).toBe("opencode");
expect(provider.envVars).toEqual(["OPENCODE_API_KEY", "OPENCODE_ZEN_API_KEY"]);
expect(provider.auth.map((method) => method.id)).toEqual(["api-key"]);
expect(provider.auth.map((method) => method.wizard?.choiceId)).toEqual(["opencode-zen"]);
expect(provider.auth[0]?.wizard).toMatchObject({
choiceLabel: "OpenCode Zen catalog",
groupId: "opencode",
groupHint: "Shared API key for Zen + Go catalogs",
});
});
it("registers image media understanding through the OpenCode plugin", async () => {
const { mediaProviders } = await registerProviderPlugin({
plugin,