fix: align opencode-zen provider setup

This commit is contained in:
Peter Steinberger
2026-01-10 21:37:38 +01:00
parent 46e00ad5e7
commit 8a194b4abc
16 changed files with 263 additions and 96 deletions

View File

@@ -7,7 +7,7 @@ import {
} from "./opencode-zen-model-default.js";
describe("applyOpencodeZenModelDefault", () => {
it("sets opencode-zen default when model is unset", () => {
it("sets opencode default when model is unset", () => {
const cfg: ClawdbotConfig = { agents: { defaults: {} } };
const applied = applyOpencodeZenModelDefault(cfg);
expect(applied.changed).toBe(true);
@@ -36,6 +36,15 @@ describe("applyOpencodeZenModelDefault", () => {
expect(applied.next).toEqual(cfg);
});
it("no-ops when already legacy opencode-zen default", () => {
const cfg = {
agents: { defaults: { model: "opencode-zen/claude-opus-4-5" } },
} as ClawdbotConfig;
const applied = applyOpencodeZenModelDefault(cfg);
expect(applied.changed).toBe(false);
expect(applied.next).toEqual(cfg);
});
it("preserves fallbacks when setting primary", () => {
const cfg: ClawdbotConfig = {
agents: {