fix(doctor): warn on opencode overrides

This commit is contained in:
Peter Steinberger
2026-01-10 22:44:27 +01:00
parent 2a86e40730
commit ad17966e2f
3 changed files with 77 additions and 0 deletions

View File

@@ -1001,4 +1001,39 @@ describe("doctor", () => {
expect(stateNote).toBeTruthy();
expect(String(stateNote?.[0])).toContain("CRITICAL");
});
it("warns about opencode provider overrides", async () => {
readConfigFileSnapshot.mockResolvedValue({
path: "/tmp/clawdbot.json",
exists: true,
raw: "{}",
parsed: {},
valid: true,
config: {
models: {
providers: {
opencode: {
api: "openai-completions",
baseUrl: "https://opencode.ai/zen/v1",
},
},
},
},
issues: [],
legacyIssues: [],
});
const { doctorCommand } = await import("./doctor.js");
await doctorCommand(
{ log: vi.fn(), error: vi.fn(), exit: vi.fn() },
{ nonInteractive: true, workspaceSuggestions: false },
);
const warned = note.mock.calls.some(
([message, title]) =>
title === "OpenCode Zen" &&
String(message).includes("models.providers.opencode"),
);
expect(warned).toBe(true);
});
});