mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-18 15:14:45 +00:00
test: tighten kimi coding provider assertions
This commit is contained in:
@@ -47,10 +47,42 @@ describe("Kimi implicit provider (#22409)", () => {
|
||||
it("publishes the Kimi provider when an API key is resolved", async () => {
|
||||
const provider = await runKimiCatalogProvider({ apiKey: "test-key" });
|
||||
|
||||
expect(provider).toMatchObject({
|
||||
apiKey: "test-key",
|
||||
expect(provider).toEqual({
|
||||
baseUrl: "https://api.kimi.com/coding/",
|
||||
api: "anthropic-messages",
|
||||
headers: {
|
||||
"User-Agent": "claude-code/0.1.0",
|
||||
},
|
||||
models: [
|
||||
{
|
||||
id: "kimi-for-coding",
|
||||
name: "Kimi Code",
|
||||
reasoning: true,
|
||||
input: ["text", "image"],
|
||||
cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 },
|
||||
contextWindow: 262144,
|
||||
maxTokens: 32768,
|
||||
},
|
||||
{
|
||||
id: "kimi-code",
|
||||
name: "Kimi Code (legacy kimi-code)",
|
||||
reasoning: true,
|
||||
input: ["text", "image"],
|
||||
cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 },
|
||||
contextWindow: 262144,
|
||||
maxTokens: 32768,
|
||||
},
|
||||
{
|
||||
id: "k2p5",
|
||||
name: "Kimi Code (legacy k2p5)",
|
||||
reasoning: true,
|
||||
input: ["text", "image"],
|
||||
cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 },
|
||||
contextWindow: 262144,
|
||||
maxTokens: 32768,
|
||||
},
|
||||
],
|
||||
apiKey: "test-key",
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -17,7 +17,12 @@ describe("kimi provider plugin", () => {
|
||||
api: "anthropic-messages",
|
||||
},
|
||||
} as never),
|
||||
).toMatchObject({ id: "kimi-for-coding" });
|
||||
).toEqual({
|
||||
id: "kimi-for-coding",
|
||||
name: "Kimi Code",
|
||||
provider: "kimi",
|
||||
api: "anthropic-messages",
|
||||
});
|
||||
});
|
||||
|
||||
it("uses binary thinking with thinking off by default", async () => {
|
||||
|
||||
@@ -17,9 +17,20 @@ describe("kimi coding onboard", () => {
|
||||
const cfg = applyKimiCodeProviderConfig({});
|
||||
const provider = cfg.models?.providers?.kimi;
|
||||
|
||||
expect(provider).toMatchObject({
|
||||
expect(provider).toEqual({
|
||||
api: "anthropic-messages",
|
||||
baseUrl: "https://api.kimi.com/coding/",
|
||||
models: [
|
||||
{
|
||||
id: "kimi-for-coding",
|
||||
name: "Kimi Code",
|
||||
reasoning: true,
|
||||
input: ["text", "image"],
|
||||
cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 },
|
||||
contextWindow: 262144,
|
||||
maxTokens: 32768,
|
||||
},
|
||||
],
|
||||
});
|
||||
expect(provider?.models?.map((model) => model.id)).toEqual(["kimi-for-coding"]);
|
||||
expect(cfg.agents?.defaults?.models?.[KIMI_MODEL_REF]?.alias).toBe("Kimi");
|
||||
|
||||
Reference in New Issue
Block a user