mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-28 20:46:57 +02:00
44 lines
1.3 KiB
TypeScript
44 lines
1.3 KiB
TypeScript
import { describe, expect, it } from "vitest";
|
|
import { registerProviderPlugin } from "../../test/helpers/plugins/provider-registration.js";
|
|
import { expectPassthroughReplayPolicy } from "../../test/helpers/provider-replay-policy.ts";
|
|
import plugin from "./index.js";
|
|
|
|
describe("opencode provider plugin", () => {
|
|
it("registers image media understanding through the OpenCode plugin", async () => {
|
|
const { mediaProviders } = await registerProviderPlugin({
|
|
plugin,
|
|
id: "opencode",
|
|
name: "OpenCode Zen Provider",
|
|
});
|
|
|
|
expect(mediaProviders).toEqual(
|
|
expect.arrayContaining([
|
|
expect.objectContaining({
|
|
id: "opencode",
|
|
capabilities: ["image"],
|
|
defaultModels: { image: "gpt-5-nano" },
|
|
describeImage: expect.any(Function),
|
|
describeImages: expect.any(Function),
|
|
}),
|
|
]),
|
|
);
|
|
});
|
|
|
|
it("owns passthrough-gemini replay policy for Gemini-backed models", async () => {
|
|
await expectPassthroughReplayPolicy({
|
|
plugin,
|
|
providerId: "opencode",
|
|
modelId: "gemini-2.5-pro",
|
|
sanitizeThoughtSignatures: true,
|
|
});
|
|
});
|
|
|
|
it("keeps non-Gemini replay policy minimal on passthrough routes", async () => {
|
|
await expectPassthroughReplayPolicy({
|
|
plugin,
|
|
providerId: "opencode",
|
|
modelId: "claude-opus-4.6",
|
|
});
|
|
});
|
|
});
|