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

推荐订阅源

钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Apple Machine Learning Research
Apple Machine Learning Research
T
Tailwind CSS Blog
月光博客
月光博客
爱范儿
爱范儿
有赞技术团队
有赞技术团队
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
aimingoo的专栏
aimingoo的专栏
GbyAI
GbyAI
腾讯CDC
The Cloudflare Blog
人人都是产品经理
人人都是产品经理
MongoDB | Blog
MongoDB | Blog
Microsoft Azure Blog
Microsoft Azure Blog
IT之家
IT之家
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
云风的 BLOG
云风的 BLOG
U
Unit 42
博客园 - 三生石上(FineUI控件)
A
About on SuperTechFans
N
Netflix TechBlog - Medium
Google DeepMind News
Google DeepMind News
雷峰网
雷峰网
L
LangChain 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: tighten message tool assertions · openclaw/openclaw...
steipete · 2026-05-10 · via Recent Commits to openclaw:main

@@ -237,6 +237,23 @@ function getActionEnum(properties: Record<string, unknown>) {

237237

return (properties.action as { enum?: string[] } | undefined)?.enum ?? [];

238238

}

239239240+

function expectStringSchema(

241+

schema: unknown,

242+

expected?: {

243+

descriptionIncludes?: string;

244+

},

245+

) {

246+

expect(schema).toBeTruthy();

247+

if (!schema || typeof schema !== "object") {

248+

throw new Error("Expected string schema");

249+

}

250+

const record = schema as Record<string, unknown>;

251+

expect(record.type).toBe("string");

252+

if (expected?.descriptionIncludes) {

253+

expect(record.description).toEqual(expect.stringContaining(expected.descriptionIncludes));

254+

}

255+

}

256+240257

beforeAll(async () => {

241258

({ resetPluginRuntimeStateForTest, setActivePluginRegistry } =

242259

await import("../../plugins/runtime.js"));

@@ -641,14 +658,10 @@ describe("message tool Telegram topic targets", () => {

641658

},

642659

});

643660644-

expect(call?.params).toEqual(

645-

expect.objectContaining({

646-

channel: "telegram",

647-

target: "-1001234567890:topic:42",

648-

threadId: "42",

649-

message: "topic hello",

650-

}),

651-

);

661+

expect(call?.params?.channel).toBe("telegram");

662+

expect(call?.params?.target).toBe("-1001234567890:topic:42");

663+

expect(call?.params?.threadId).toBe("42");

664+

expect(call?.params?.message).toBe("topic hello");

652665

});

653666

});

654667

@@ -920,19 +933,17 @@ describe("message tool schema scoping", () => {

920933

requesterSenderId: "user-42",

921934

});

922935923-

expect(seenContexts).toContainEqual(

924-

expect.objectContaining({

925-

currentChannelProvider: "discord",

926-

currentChannelId: "channel:123",

927-

currentThreadTs: "thread-456",

928-

currentMessageId: "msg-789",

929-

accountId: "ops",

930-

sessionKey: "agent:alpha:main",

931-

sessionId: "session-123",

932-

agentId: "alpha",

933-

requesterSenderId: "user-42",

934-

}),

935-

);

936+

const context = seenContexts.find((item) => item.phase === "describeMessageTool");

937+

expect(context).toBeDefined();

938+

expect(context?.currentChannelProvider).toBe("discord");

939+

expect(context?.currentChannelId).toBe("channel:123");

940+

expect(context?.currentThreadTs).toBe("thread-456");

941+

expect(context?.currentMessageId).toBe("msg-789");

942+

expect(context?.accountId).toBe("ops");

943+

expect(context?.sessionKey).toBe("agent:alpha:main");

944+

expect(context?.sessionId).toBe("session-123");

945+

expect(context?.agentId).toBe("alpha");

946+

expect(context?.requesterSenderId).toBe("user-42");

936947

});

937948938949

it("forwards senderIsOwner into plugin action discovery", () => {

@@ -967,18 +978,18 @@ describe("message tool schema scoping", () => {

967978968979

expect(getActionEnum(getToolProperties(ownerTool))).toContain("set-profile");

969980

expect(getActionEnum(getToolProperties(nonOwnerTool))).not.toContain("set-profile");

970-

expect(seenContexts).toContainEqual(expect.objectContaining({ senderIsOwner: true }));

971-

expect(seenContexts).toContainEqual(expect.objectContaining({ senderIsOwner: false }));

981+

expect(seenContexts.some((context) => context.senderIsOwner === true)).toBe(true);

982+

expect(seenContexts.some((context) => context.senderIsOwner === false)).toBe(true);

972983

});

973984974985

it("keeps core send and broadcast actions in unscoped schemas", () => {

975986

const tool = createMessageTool({

976987

config: {} as never,

977988

});

978989979-

expect(getActionEnum(getToolProperties(tool))).toEqual(

980-

expect.arrayContaining(["send", "broadcast"]),

981-

);

990+

const actionEnum = getActionEnum(getToolProperties(tool));

991+

expect(actionEnum).toContain("send");

992+

expect(actionEnum).toContain("broadcast");

982993

});

983994984995

it("advertises Slack download-file fileId in scoped schemas", () => {

@@ -1001,7 +1012,7 @@ describe("message tool schema scoping", () => {

10011012

const properties = getToolProperties(tool);

1002101310031014

expect(getActionEnum(properties)).toContain("download-file");

1004-

expect(properties.fileId).toMatchObject({ type: "string" });

1015+

expectStringSchema(properties.fileId);

10051016

});

1006101710071018

it("advertises messageId for read actions", () => {

@@ -1024,10 +1035,7 @@ describe("message tool schema scoping", () => {

10241035

const properties = getToolProperties(tool);

1025103610261037

expect(getActionEnum(properties)).toContain("read");

1027-

expect(properties.messageId).toMatchObject({

1028-

type: "string",

1029-

description: expect.stringContaining("read"),

1030-

});

1038+

expectStringSchema(properties.messageId, { descriptionIncludes: "read" });

10311039

});

10321040

});

10331041