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

推荐订阅源

博客园 - 【当耐特】
Stack Overflow Blog
Stack Overflow Blog
V
Visual Studio Blog
小众软件
小众软件
The Cloudflare Blog
T
Tailwind CSS Blog
Apple Machine Learning Research
Apple Machine Learning Research
爱范儿
爱范儿
美团技术团队
WordPress大学
WordPress大学
罗磊的独立博客
Microsoft Azure Blog
Microsoft Azure Blog
A
About on SuperTechFans
Last Week in AI
Last Week in AI
月光博客
月光博客
博客园 - Franky
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
G
Google Developers Blog
GbyAI
GbyAI
B
Blog
大猫的无限游戏
大猫的无限游戏
博客园 - 聂微东
Hugging Face - Blog
Hugging Face - 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 mattermost monitor mock reads · openclaw/ope...
steipete · 2026-05-13 · via Recent Commits to openclaw:main

@@ -100,6 +100,23 @@ function evaluateMentionGateForMessage(params: { cfg: OpenClawConfig; threadRoot

100100

return { account, resolver, decision };

101101

}

102102103+

function mockCall(mock: { mock: { calls: unknown[][] } }, index: number, label: string): unknown[] {

104+

const resolvedIndex = index < 0 ? mock.mock.calls.length + index : index;

105+

const call = mock.mock.calls[resolvedIndex];

106+

if (!call) {

107+

throw new Error(`expected ${label} call ${index}`);

108+

}

109+

return call;

110+

}

111+112+

function mockCallArg(

113+

mock: { mock: { calls: unknown[][] } },

114+

index: number,

115+

label: string,

116+

): unknown {

117+

return mockCall(mock, index, label)[0];

118+

}

119+103120

describe("mattermost mention gating", () => {

104121

it("accepts unmentioned root channel posts in onmessage mode", () => {

105122

const cfg: OpenClawConfig = {

@@ -114,7 +131,7 @@ describe("mattermost mention gating", () => {

114131

expect(decision.dropReason).toBeNull();

115132

expect(decision.shouldRequireMention).toBe(false);

116133

expect(resolver).toHaveBeenCalledTimes(1);

117-

const [resolverCall] = resolver.mock.calls.at(0) ?? [];

134+

const resolverCall = mockCallArg(resolver, 0, "resolveRequireMention");

118135

expect(resolverCall).toStrictEqual({

119136

cfg,

120137

channel: "mattermost",

@@ -139,9 +156,11 @@ describe("mattermost mention gating", () => {

139156

});

140157

expect(decision.dropReason).toBeNull();

141158

expect(decision.shouldRequireMention).toBe(false);

142-

const resolverCall = resolver.mock.calls.at(-1)?.[0];

143-

expect(resolverCall?.groupId).toBe("chan-1");

144-

expect(resolverCall?.groupId).not.toBe("thread-root-1");

159+

const resolverCall = mockCallArg(resolver, -1, "resolveRequireMention") as {

160+

groupId?: string;

161+

};

162+

expect(resolverCall.groupId).toBe("chan-1");

163+

expect(resolverCall.groupId).not.toBe("thread-root-1");

145164

});

146165147166

it("rejects unmentioned channel posts in oncall mode", () => {

@@ -493,8 +512,11 @@ describe("deliverMattermostReplyWithDraftPreview", () => {

493512

});

494513495514

expect(updateMattermostPostSpy).toHaveBeenCalledTimes(1);

496-

const [updateClient, updatePostId, updateParams] =

497-

updateMattermostPostSpy.mock.calls.at(0) ?? [];

515+

const [updateClient, updatePostId, updateParams] = mockCall(

516+

updateMattermostPostSpy,

517+

0,

518+

"updateMattermostPost",

519+

);

498520

expect(updateClient).toBe(client);

499521

expect(updatePostId).toBe("preview-post-1");

500522

expect(updateParams).toStrictEqual({ message: "Final answer" });