fix(doctor): warn on opencode overrides
This commit is contained in:
@@ -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);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user