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

推荐订阅源

月光博客
月光博客
人人都是产品经理
人人都是产品经理
博客园 - 聂微东
WordPress大学
WordPress大学
S
SegmentFault 最新的问题
博客园 - Franky
V
V2EX
Y
Y Combinator Blog
Google DeepMind News
Google DeepMind News
J
Java Code Geeks
T
The Blog of Author Tim Ferriss
罗磊的独立博客
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Jina AI
Jina AI
博客园 - 叶小钗
F
Fortinet All Blogs
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
A
About on SuperTechFans
M
MIT News - Artificial intelligence
云风的 BLOG
云风的 BLOG
Last Week in AI
Last Week in AI
D
Docker
博客园 - 【当耐特】
阮一峰的网络日志
阮一峰的网络日志

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: tighten tool adapter assertions · openclaw/openclaw...
steipete · 2026-05-10 · via Recent Commits to openclaw:main

@@ -46,22 +46,24 @@ describe("pi tool definition adapter", () => {

4646

it("wraps tool errors into a tool result", async () => {

4747

const result = await executeThrowingTool("boom", "call1");

484849-

expect(result.details).toMatchObject({

50-

status: "error",

51-

tool: "boom",

52-

});

53-

expect(result.details).toMatchObject({ error: "nope" });

49+

const details = result.details as

50+

| { status?: string; tool?: string; error?: string }

51+

| undefined;

52+

expect(details?.status).toBe("error");

53+

expect(details?.tool).toBe("boom");

54+

expect(details?.error).toBe("nope");

5455

expect(JSON.stringify(result.details)).not.toContain("\n at ");

5556

});

56575758

it("normalizes exec tool aliases in error results", async () => {

5859

const result = await executeThrowingTool("bash", "call2");

596060-

expect(result.details).toMatchObject({

61-

status: "error",

62-

tool: "exec",

63-

error: "nope",

64-

});

61+

const details = result.details as

62+

| { status?: string; tool?: string; error?: string }

63+

| undefined;

64+

expect(details?.status).toBe("error");

65+

expect(details?.tool).toBe("exec");

66+

expect(details?.error).toBe("nope");

6567

});

66686769

it("coerces details-only tool results to include content", async () => {

@@ -81,7 +83,7 @@ describe("pi tool definition adapter", () => {

8183

expect(result.details).toEqual({

8284

hits: [{ id: "a1", score: 0.9 }],

8385

});

84-

expect(result.content[0]).toMatchObject({ type: "text" });

86+

expect(result.content[0]?.type).toBe("text");

8587

expect((result.content[0] as { text?: string }).text).toContain('"hits"');

8688

});

8789

@@ -102,7 +104,7 @@ describe("pi tool definition adapter", () => {

102104

count: 2,

103105

ids: ["m1", "m2"],

104106

});

105-

expect(result.content[0]).toMatchObject({ type: "text" });

107+

expect(result.content[0]?.type).toBe("text");

106108

expect((result.content[0] as { text?: string }).text).toContain('"count"');

107109

});

108110

});