惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

腾讯CDC
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
P
Proofpoint News Feed
D
DataBreaches.Net
D
Docker
云风的 BLOG
云风的 BLOG
大猫的无限游戏
大猫的无限游戏
月光博客
月光博客
J
Java Code Geeks
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
罗磊的独立博客
Martin Fowler
Martin Fowler
U
Unit 42
Engineering at Meta
Engineering at Meta
IT之家
IT之家
Vercel News
Vercel News
B
Blog RSS Feed
人人都是产品经理
人人都是产品经理
博客园 - Franky
博客园 - 【当耐特】
Stack Overflow Blog
Stack Overflow Blog
G
Google Developers Blog
MongoDB | Blog
MongoDB | Blog

Recent Commits to openclaw:main

test: merge chat side-result checks · openclaw/openclaw@ddd2c2a test: merge cron history checks · openclaw/openclaw@f7eb746 test: merge responsive navigation shell checks · openclaw/openclaw@c2e4b47 docs(changelog): add codex oauth fixes · openclaw/openclaw@628e6cd test: merge navigation routing cases · openclaw/openclaw@5d8cecb Tests: mock channel registry bundled fallback · openclaw/openclaw@2b08233 Secrets: avoid broad web search discovery for single plugin config · openclaw/openclaw@a464f59 test: merge config view browser checks · openclaw/openclaw@20cf511 fix(status): align oauth health with runtime · openclaw/openclaw@eed7116 feat: add macOS screen snapshots for monitor preview (#67954) thanks … · openclaw/openclaw@f377db1 fix: report shared auth scopes in hello-ok (#67810) thanks @BunsDev · openclaw/openclaw@0b6c39b Auto-reply: avoid eager bundled route fallback · openclaw/openclaw@3ea1bf4 Tests: narrow session binding contract setup · openclaw/openclaw@54e4e16 fix(macOS): enable undo/redo in webchat composer text input (#34962) · openclaw/openclaw@00951dc Tests: speed up channel setup promotion · openclaw/openclaw@82b529a Docs: refresh agent instructions · openclaw/openclaw@5775fe2 fix(auth): serialize OAuth refresh across agents to fix #26322 (#67876) · openclaw/openclaw@8e79080 test: allow ollama public surface boundary test · openclaw/openclaw@7d4f1a6 Docs: add test performance guardrails · openclaw/openclaw@89706d3 Tests: restore context-engine usage proof · openclaw/openclaw@e4c4f95 Tests: slim context engine runtime coverage · openclaw/openclaw@74c198f ci: retry failed custom checkouts · openclaw/openclaw@0ee5baf test: trim duplicate provider auth onboarding cases · openclaw/openclaw@1ffc02e matrix: fix sessions_spawn --thread subagent session spawning (#67643) · openclaw/openclaw@1ce2596 test: reduce auth choice fixture churn · openclaw/openclaw@857b9cd test: mock health status config boundaries · openclaw/openclaw@9d5ab4a test: mock onboard config io boundary · openclaw/openclaw@299694d test: mock legacy state plugin boundaries · openclaw/openclaw@2713089 test: mock channel install boundaries · openclaw/openclaw@b945248 test: mock doctor preview channel boundaries · openclaw/openclaw@b1a3ad4
test: dedupe image generation tool assertions · openclaw/...
steipete · 2026-05-08 · via Recent Commits to openclaw:main

@@ -286,7 +286,7 @@ describe("createImageGenerateTool", () => {

286286

throw new Error("runtime provider list should not run during tool registration");

287287

});

288288289-

expect(

289+

requireImageGenerateTool(

290290

createImageGenerateTool({

291291

config: {

292292

agents: {

@@ -298,7 +298,7 @@ describe("createImageGenerateTool", () => {

298298

},

299299

},

300300

}),

301-

).not.toBeNull();

301+

);

302302

expect(listProviders).not.toHaveBeenCalled();

303303

});

304304

@@ -325,7 +325,7 @@ describe("createImageGenerateTool", () => {

325325

},

326326

]);

327327328-

expect(

328+

requireImageGenerateTool(

329329

createImageGenerateTool({

330330

config: {

331331

agents: {

@@ -337,7 +337,7 @@ describe("createImageGenerateTool", () => {

337337

},

338338

},

339339

}),

340-

).not.toBeNull();

340+

);

341341

});

342342343343

it("infers an OpenAI image-generation model from env-backed auth", () => {

@@ -347,7 +347,7 @@ describe("createImageGenerateTool", () => {

347347

expect(resolveImageGenerationModelConfigForTool({ cfg: {} })).toEqual({

348348

primary: "openai/gpt-image-1",

349349

});

350-

expect(createImageGenerateTool({ config: {} })).not.toBeNull();

350+

requireImageGenerateTool(createImageGenerateTool({ config: {} }));

351351

});

352352353353

it("does not load runtime providers while resolving an explicitly configured model", () => {

@@ -410,7 +410,7 @@ describe("createImageGenerateTool", () => {

410410

).toEqual({

411411

primary: "openai/gpt-image-2",

412412

});

413-

expect(createImageGenerateTool({ config: {}, agentDir: "/tmp/agent" })).not.toBeNull();

413+

requireImageGenerateTool(createImageGenerateTool({ config: {}, agentDir: "/tmp/agent" }));

414414

expect(isConfigured).toHaveBeenCalledWith({

415415

cfg: {},

416416

agentDir: "/tmp/agent",

@@ -548,24 +548,21 @@ describe("createImageGenerateTool", () => {

548548

contentType: "image/png",

549549

});

550550551-

const tool = createImageGenerateTool({

552-

config: {

553-

agents: {

554-

defaults: {

555-

mediaMaxMb: 8,

556-

imageGenerationModel: {

557-

primary: "openai/gpt-image-1",

551+

const tool = requireImageGenerateTool(

552+

createImageGenerateTool({

553+

config: {

554+

agents: {

555+

defaults: {

556+

mediaMaxMb: 8,

557+

imageGenerationModel: {

558+

primary: "openai/gpt-image-1",

559+

},

558560

},

559561

},

560562

},

561-

},

562-

agentDir: "/tmp/agent",

563-

});

564-565-

expect(tool).not.toBeNull();

566-

if (!tool) {

567-

throw new Error("expected image_generate tool");

568-

}

563+

agentDir: "/tmp/agent",

564+

}),

565+

);

569566570567

const result = await tool.execute("call-1", {

571568

prompt: "A cat wearing sunglasses",

@@ -856,19 +853,17 @@ describe("createImageGenerateTool", () => {

856853

contentType: "image/jpeg",

857854

});

858855859-

const tool = createImageGenerateTool({

860-

config: {

861-

agents: {

862-

defaults: {

863-

imageGenerationModel: { primary: "google/gemini-3.1-flash-image-preview" },

856+

const tool = requireImageGenerateTool(

857+

createImageGenerateTool({

858+

config: {

859+

agents: {

860+

defaults: {

861+

imageGenerationModel: { primary: "google/gemini-3.1-flash-image-preview" },

862+

},

864863

},

865864

},

866-

},

867-

});

868-

expect(tool).not.toBeNull();

869-

if (!tool) {

870-

throw new Error("expected image_generate tool");

871-

}

865+

}),

866+

);

872867873868

const result = await tool.execute("call-regression", { prompt: "kodo sawaki zazen" });

874869

const text = (result.content?.[0] as { text: string } | undefined)?.text ?? "";

@@ -913,21 +908,19 @@ describe("createImageGenerateTool", () => {

913908

}),

914909

},

915910

]);

916-

const tool = createImageGenerateTool({

917-

config: {

918-

agents: {

919-

defaults: {

920-

imageGenerationModel: {

921-

primary: "google/gemini-3.1-flash-image-preview",

911+

const tool = requireImageGenerateTool(

912+

createImageGenerateTool({

913+

config: {

914+

agents: {

915+

defaults: {

916+

imageGenerationModel: {

917+

primary: "google/gemini-3.1-flash-image-preview",

918+

},

922919

},

923920

},

924921

},

925-

},

926-

});

927-

expect(tool).not.toBeNull();

928-

if (!tool) {

929-

throw new Error("expected image_generate tool");

930-

}

922+

}),

923+

);

931924932925

await expect(tool.execute("call-2", { prompt: "too many cats", count: 5 })).rejects.toThrow(

933926

"count must be between 1 and 4",

@@ -1363,22 +1356,19 @@ describe("createImageGenerateTool", () => {

13631356

it("rejects unsupported aspect ratios", async () => {

13641357

stubImageGenerationProviders();

136513581366-

const tool = createImageGenerateTool({

1367-

config: {

1368-

agents: {

1369-

defaults: {

1370-

imageGenerationModel: {

1371-

primary: "google/gemini-3-pro-image-preview",

1359+

const tool = requireImageGenerateTool(

1360+

createImageGenerateTool({

1361+

config: {

1362+

agents: {

1363+

defaults: {

1364+

imageGenerationModel: {

1365+

primary: "google/gemini-3-pro-image-preview",

1366+

},

13721367

},

13731368

},

13741369

},

1375-

},

1376-

});

1377-1378-

expect(tool).not.toBeNull();

1379-

if (!tool) {

1380-

throw new Error("expected image_generate tool");

1381-

}

1370+

}),

1371+

);

1382137213831373

await expect(

13841374

tool.execute("call-bad-aspect", { prompt: "portrait", aspectRatio: "7:5" }),

@@ -1390,22 +1380,19 @@ describe("createImageGenerateTool", () => {

13901380

it("lists registered provider and model options", async () => {

13911381

stubImageGenerationProviders();

139213821393-

const tool = createImageGenerateTool({

1394-

config: {

1395-

agents: {

1396-

defaults: {

1397-

imageGenerationModel: {

1398-

primary: "google/gemini-3.1-flash-image-preview",

1383+

const tool = requireImageGenerateTool(

1384+

createImageGenerateTool({

1385+

config: {

1386+

agents: {

1387+

defaults: {

1388+

imageGenerationModel: {

1389+

primary: "google/gemini-3.1-flash-image-preview",

1390+

},

13991391

},

14001392

},

14011393

},

1402-

},

1403-

});

1404-1405-

expect(tool).not.toBeNull();

1406-

if (!tool) {

1407-

throw new Error("expected image_generate tool");

1408-

}

1394+

}),

1395+

);

1409139614101397

const result = await tool.execute("call-list", { action: "list" });

14111398

const text = (result.content?.[0] as { text: string } | undefined)?.text ?? "";

@@ -1467,22 +1454,19 @@ describe("createImageGenerateTool", () => {

14671454

},

14681455

]);

146914561470-

const tool = createImageGenerateTool({

1471-

config: {

1472-

agents: {

1473-

defaults: {

1474-

imageGenerationModel: {

1475-

primary: "__proto__/proto-v1",

1457+

const tool = requireImageGenerateTool(

1458+

createImageGenerateTool({

1459+

config: {

1460+

agents: {

1461+

defaults: {

1462+

imageGenerationModel: {

1463+

primary: "__proto__/proto-v1",

1464+

},

14761465

},

14771466

},

14781467

},

1479-

},

1480-

});

1481-1482-

expect(tool).not.toBeNull();

1483-

if (!tool) {

1484-

throw new Error("expected image_generate tool");

1485-

}

1468+

}),

1469+

);

1486147014871471

const result = await tool.execute("call-list-proto", { action: "list" });

14881472

const text = (result.content?.[0] as { text: string } | undefined)?.text ?? "";