mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-17 03:03:44 +00:00
feat(ai,coding-agent): add OpenCode Go provider support closes #1757
This commit is contained in:
parent
1912f0336b
commit
42579dd923
11 changed files with 107 additions and 22 deletions
|
|
@ -101,6 +101,9 @@ const PROVIDER_MODEL_PAIRS: ProviderModelPair[] = [
|
|||
{ provider: "opencode", model: "glm-4.7-free", label: "zen-glm-4.7-free" },
|
||||
{ provider: "opencode", model: "gpt-5.2-codex", label: "zen-gpt-5.2-codex" },
|
||||
{ provider: "opencode", model: "minimax-m2.1-free", label: "zen-minimax-m2.1-free" },
|
||||
// OpenCode Go
|
||||
{ provider: "opencode-go", model: "kimi-k2.5", label: "go-kimi-k2.5" },
|
||||
{ provider: "opencode-go", model: "minimax-m2.5", label: "go-minimax-m2.5" },
|
||||
];
|
||||
|
||||
// Cached context structure
|
||||
|
|
|
|||
|
|
@ -3,17 +3,23 @@ import { MODELS } from "../src/models.generated.js";
|
|||
import { complete } from "../src/stream.js";
|
||||
import type { Model } from "../src/types.js";
|
||||
|
||||
describe.skipIf(!process.env.OPENCODE_API_KEY)("OpenCode Zen Models Smoke Test", () => {
|
||||
const zenModels = Object.values(MODELS.opencode);
|
||||
describe.skipIf(!process.env.OPENCODE_API_KEY)("OpenCode Models Smoke Test", () => {
|
||||
const providers = [
|
||||
{ key: "opencode", label: "OpenCode Zen" },
|
||||
{ key: "opencode-go", label: "OpenCode Go" },
|
||||
] as const;
|
||||
|
||||
zenModels.forEach((model) => {
|
||||
it(`${model.id}`, async () => {
|
||||
const response = await complete(model as Model<any>, {
|
||||
messages: [{ role: "user", content: "Say hello.", timestamp: Date.now() }],
|
||||
});
|
||||
providers.forEach(({ key, label }) => {
|
||||
const providerModels = Object.values(MODELS[key]);
|
||||
providerModels.forEach((model) => {
|
||||
it(`${label}: ${model.id}`, async () => {
|
||||
const response = await complete(model as Model<any>, {
|
||||
messages: [{ role: "user", content: "Say hello.", timestamp: Date.now() }],
|
||||
});
|
||||
|
||||
expect(response.content).toBeTruthy();
|
||||
expect(response.stopReason).toBe("stop");
|
||||
}, 60000);
|
||||
expect(response.content).toBeTruthy();
|
||||
expect(response.stopReason).toBe("stop");
|
||||
}, 60000);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue