mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-05 16:41:51 +00:00
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:
committed by
GitHub
parent
65cce37480
commit
eec2c0cc26
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user