test(ci): stabilize pricing and codex web config checks · openclaw/openclaw@05d8c27
steipete
·
2026-05-01
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
|
1 | 1 | import { describe, expect, it } from "vitest"; |
2 | 2 | import { validateConfigObjectRaw } from "./validation.js"; |
| 3 | +import { OpenClawSchema } from "./zod-schema.js"; |
3 | 4 | |
4 | 5 | describe("web search Codex native config validation", () => { |
5 | 6 | it("accepts tools.web.search.openaiCodex", () => { |
6 | | -const result = validateConfigObjectRaw({ |
| 7 | +const result = OpenClawSchema.safeParse({ |
7 | 8 | tools: { |
8 | 9 | web: { |
9 | 10 | search: { |
@@ -24,7 +25,7 @@ describe("web search Codex native config validation", () => {
|
24 | 25 | }, |
25 | 26 | }); |
26 | 27 | |
27 | | -expect(result.ok).toBe(true); |
| 28 | +expect(result.success).toBe(true); |
28 | 29 | }); |
29 | 30 | |
30 | 31 | it("rejects invalid openaiCodex.mode", () => { |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -343,7 +343,7 @@ describe("model-pricing-cache", () => {
|
343 | 343 | ], |
344 | 344 | }, |
345 | 345 | tools: { |
346 | | -subagents: { model: { primary: "zai/glm-5" } }, |
| 346 | +subagents: { model: { primary: "zai/glm-openrouter-test" } }, |
347 | 347 | }, |
348 | 348 | } as unknown as OpenClawConfig; |
349 | 349 | |
@@ -371,7 +371,7 @@ describe("model-pricing-cache", () => {
|
371 | 371 | }, |
372 | 372 | }, |
373 | 373 | { |
374 | | -id: "z-ai/glm-5", |
| 374 | +id: "z-ai/glm-openrouter-test", |
375 | 375 | pricing: { |
376 | 376 | prompt: "0.000001", |
377 | 377 | completion: "0.000004", |
@@ -413,12 +413,14 @@ describe("model-pricing-cache", () => {
|
413 | 413 | cacheRead: 0.3, |
414 | 414 | cacheWrite: 0, |
415 | 415 | }); |
416 | | -expect(getCachedGatewayModelPricing({ provider: "zai", model: "glm-5" })).toEqual({ |
417 | | -input: 1, |
418 | | -output: 4, |
419 | | -cacheRead: 0, |
420 | | -cacheWrite: 0, |
421 | | -}); |
| 416 | +expect(getCachedGatewayModelPricing({ provider: "zai", model: "glm-openrouter-test" })).toEqual( |
| 417 | +{ |
| 418 | +input: 1, |
| 419 | +output: 4, |
| 420 | +cacheRead: 0, |
| 421 | +cacheWrite: 0, |
| 422 | +}, |
| 423 | +); |
422 | 424 | }); |
423 | 425 | |
424 | 426 | it("does not recurse forever for native openrouter auto refs", async () => { |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。