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

推荐订阅源

量子位
雷峰网
雷峰网
博客园 - 三生石上(FineUI控件)
月光博客
月光博客
有赞技术团队
有赞技术团队
阮一峰的网络日志
阮一峰的网络日志
Last Week in AI
Last Week in AI
G
Google Developers Blog
腾讯CDC
B
Blog
Microsoft Azure Blog
Microsoft Azure Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
Microsoft Security Blog
Microsoft Security Blog
人人都是产品经理
人人都是产品经理
博客园_首页
T
Tailwind CSS Blog
C
Check Point Blog
博客园 - 【当耐特】
MongoDB | Blog
MongoDB | Blog
A
About on SuperTechFans
Y
Y Combinator Blog
L
LangChain Blog
Engineering at Meta
Engineering at Meta
GbyAI
GbyAI

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 dispatch hook metadata assertions · opencla...
steipete · 2026-05-10 · via Recent Commits to openclaw:main

@@ -2797,12 +2797,10 @@ describe("dispatchReplyFromConfig", () => {

2797279727982798

await dispatchReplyFromConfig({ ctx, cfg, dispatcher, replyResolver });

279927992800-

expect(dispatcher.sendToolResult).toHaveBeenCalledWith(

2801-

expect.objectContaining({ text: "Approval required." }),

2802-

);

2803-

expect(dispatcher.sendFinalReply).toHaveBeenCalledWith(

2804-

expect.objectContaining({ text: "done" }),

2805-

);

2800+

expect(firstToolResultPayload(dispatcher)?.text).toBe("Approval required.");

2801+

expect(

2802+

((dispatcher.sendFinalReply as Mock).mock.calls[0]?.[0] as ReplyPayload | undefined)?.text,

2803+

).toBe("done");

28062804

});

2807280528082806

it("suppresses local discord exec approval tool prompts when the native runtime is active", async () => {

@@ -2850,9 +2848,9 @@ describe("dispatchReplyFromConfig", () => {

28502848

await dispatchReplyFromConfig({ ctx, cfg, dispatcher, replyResolver });

2851284928522850

expect(dispatcher.sendToolResult).not.toHaveBeenCalled();

2853-

expect(dispatcher.sendFinalReply).toHaveBeenCalledWith(

2854-

expect.objectContaining({ text: "done" }),

2855-

);

2851+

expect(

2852+

((dispatcher.sendFinalReply as Mock).mock.calls[0]?.[0] as ReplyPayload | undefined)?.text,

2853+

).toBe("done");

28562854

} finally {

28572855

await reporter.stop();

28582856

}

@@ -2917,29 +2915,32 @@ describe("dispatchReplyFromConfig", () => {

29172915

const replyResolver = async () => ({ text: "hi" }) satisfies ReplyPayload;

29182916

await dispatchReplyFromConfig({ ctx, cfg, dispatcher, replyResolver });

291929172920-

expect(hookMocks.runner.runMessageReceived).toHaveBeenCalledWith(

2921-

expect.objectContaining({

2922-

from: ctx.From,

2923-

content: "/search hello",

2924-

timestamp: 1710000000000,

2925-

metadata: expect.objectContaining({

2926-

originatingChannel: "Telegram",

2927-

originatingTo: "telegram:999",

2928-

messageId: "sid-full",

2929-

senderId: "user-1",

2930-

senderName: "Alice",

2931-

senderUsername: "alice",

2932-

senderE164: "+15555550123",

2933-

guildId: "guild-123",

2934-

channelName: "alerts",

2935-

}),

2936-

}),

2937-

expect.objectContaining({

2938-

channelId: "telegram",

2939-

accountId: "acc-1",

2940-

conversationId: "telegram:999",

2941-

}),

2942-

);

2918+

const [event, hookContext] = hookMocks.runner.runMessageReceived.mock.calls[0] as

2919+

| [

2920+

{

2921+

content?: unknown;

2922+

from?: unknown;

2923+

metadata?: Record<string, unknown>;

2924+

timestamp?: unknown;

2925+

},

2926+

{ accountId?: unknown; channelId?: unknown; conversationId?: unknown },

2927+

]

2928+

| [];

2929+

expect(event?.from).toBe(ctx.From);

2930+

expect(event?.content).toBe("/search hello");

2931+

expect(event?.timestamp).toBe(1710000000000);

2932+

expect(event?.metadata?.originatingChannel).toBe("Telegram");

2933+

expect(event?.metadata?.originatingTo).toBe("telegram:999");

2934+

expect(event?.metadata?.messageId).toBe("sid-full");

2935+

expect(event?.metadata?.senderId).toBe("user-1");

2936+

expect(event?.metadata?.senderName).toBe("Alice");

2937+

expect(event?.metadata?.senderUsername).toBe("alice");

2938+

expect(event?.metadata?.senderE164).toBe("+15555550123");

2939+

expect(event?.metadata?.guildId).toBe("guild-123");

2940+

expect(event?.metadata?.channelName).toBe("alerts");

2941+

expect(hookContext?.channelId).toBe("telegram");

2942+

expect(hookContext?.accountId).toBe("acc-1");

2943+

expect(hookContext?.conversationId).toBe("telegram:999");

29432944

});

2944294529452946

it("does not broadcast inbound claims without a core-owned plugin binding", async () => {

@@ -2975,36 +2976,35 @@ describe("dispatchReplyFromConfig", () => {

2975297629762977

expect(result).toEqual({ queuedFinal: true, counts: { tool: 0, block: 0, final: 0 } });

29772978

expect(hookMocks.runner.runInboundClaim).not.toHaveBeenCalled();

2978-

expect(hookMocks.runner.runMessageReceived).toHaveBeenCalledWith(

2979-

expect.objectContaining({

2980-

from: ctx.From,

2981-

content: "who are you",

2982-

metadata: expect.objectContaining({

2983-

messageId: "msg-claim-1",

2984-

originatingChannel: "telegram",

2985-

originatingTo: "telegram:-10099",

2986-

senderId: "user-9",

2987-

senderUsername: "ada",

2988-

threadId: 77,

2989-

}),

2990-

}),

2991-

expect.objectContaining({

2992-

channelId: "telegram",

2993-

accountId: "default",

2994-

conversationId: "telegram:-10099",

2995-

}),

2996-

);

2997-

expect(internalHookMocks.triggerInternalHook).toHaveBeenCalledWith(

2998-

expect.objectContaining({

2999-

type: "message",

3000-

action: "received",

3001-

sessionKey: "agent:main:hook-test",

3002-

}),

3003-

);

2979+

const [event, hookContext] = hookMocks.runner.runMessageReceived.mock.calls[0] as

2980+

| [

2981+

{ content?: unknown; from?: unknown; metadata?: Record<string, unknown> },

2982+

{ accountId?: unknown; channelId?: unknown; conversationId?: unknown },

2983+

]

2984+

| [];

2985+

expect(event?.from).toBe(ctx.From);

2986+

expect(event?.content).toBe("who are you");

2987+

expect(event?.metadata?.messageId).toBe("msg-claim-1");

2988+

expect(event?.metadata?.originatingChannel).toBe("telegram");

2989+

expect(event?.metadata?.originatingTo).toBe("telegram:-10099");

2990+

expect(event?.metadata?.senderId).toBe("user-9");

2991+

expect(event?.metadata?.senderUsername).toBe("ada");

2992+

expect(event?.metadata?.threadId).toBe(77);

2993+

expect(hookContext?.channelId).toBe("telegram");

2994+

expect(hookContext?.accountId).toBe("default");

2995+

expect(hookContext?.conversationId).toBe("telegram:-10099");

2996+

const internalHookEvent = (

2997+

internalHookMocks.triggerInternalHook.mock.calls as unknown as Array<

2998+

[{ action?: unknown; sessionKey?: unknown; type?: unknown }]

2999+

>

3000+

)[0]?.[0];

3001+

expect(internalHookEvent?.type).toBe("message");

3002+

expect(internalHookEvent?.action).toBe("received");

3003+

expect(internalHookEvent?.sessionKey).toBe("agent:main:hook-test");

30043004

expect(replyResolver).toHaveBeenCalledTimes(1);

3005-

expect(dispatcher.sendFinalReply).toHaveBeenCalledWith(

3006-

expect.objectContaining({ text: "core reply" }),

3007-

);

3005+

expect(

3006+

((dispatcher.sendFinalReply as Mock).mock.calls[0]?.[0] as ReplyPayload | undefined)?.text,

3007+

).toBe("core reply");

30083008

});

3009300930103010

it("emits internal message:received hook when a session key is available", async () => {