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

推荐订阅源

IT之家
IT之家
A
About on SuperTechFans
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
N
Netflix TechBlog - Medium
Microsoft Security Blog
Microsoft Security Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
博客园 - 三生石上(FineUI控件)
博客园 - 聂微东
博客园 - Franky
D
Docker
Martin Fowler
Martin Fowler
Engineering at Meta
Engineering at Meta
The Cloudflare Blog
人人都是产品经理
人人都是产品经理
Last Week in AI
Last Week in AI
U
Unit 42
F
Fortinet All Blogs
H
Help Net Security
Blog — PlanetScale
Blog — PlanetScale
Microsoft Azure Blog
Microsoft Azure Blog
罗磊的独立博客
P
Proofpoint News Feed
月光博客
月光博客
G
Google Developers 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 trigger handling mock reads · openclaw/openc...
steipete · 2026-05-13 · via Recent Commits to openclaw:main

@@ -216,6 +216,21 @@ async function runAuthorizedSmsCommand(body: string, cfg: ReturnType<typeof make

216216

return await getReplyFromConfig(makeAuthorizedSmsCommandMessage(body), {}, cfg);

217217

}

218218219+

function firstMockCallArg(

220+

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

221+

label: string,

222+

): Record<string, unknown> {

223+

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

224+

if (!call) {

225+

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

226+

}

227+

const arg = call[0];

228+

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

229+

throw new Error(`expected ${label} first argument`);

230+

}

231+

return arg as Record<string, unknown>;

232+

}

233+219234

async function expectNextRunUsesTargetSession(

220235

params: {

221236

cfg: ReturnType<typeof makeCfg>;

@@ -233,12 +248,7 @@ async function expectNextRunUsesTargetSession(

233248

);

234249235250

expect(params.runEmbeddedPiAgentMock).toHaveBeenCalledOnce();

236-

const runParams = params.runEmbeddedPiAgentMock.mock.calls.at(0)?.[0] as

237-

| Record<string, unknown>

238-

| undefined;

239-

if (!runParams) {

240-

throw new Error("expected embedded PI agent call params");

241-

}

251+

const runParams = firstMockCallArg(params.runEmbeddedPiAgentMock, "embedded PI agent");

242252

for (const [key, value] of Object.entries(expected)) {

243253

expect(runParams[key]).toEqual(value);

244254

}

@@ -473,7 +483,7 @@ describe("trigger handling", () => {

473483

expect(text, testCase.label).not.toMatch(/Thinking level set/i);

474484

expect(runEmbeddedPiAgentMock, testCase.label).toHaveBeenCalledOnce();

475485

if (testCase.assertPrompt) {

476-

const prompt = runEmbeddedPiAgentMock.mock.calls.at(0)?.[0]?.prompt ?? "";

486+

const prompt = firstMockCallArg(runEmbeddedPiAgentMock, "embedded PI agent").prompt ?? "";

477487

expect(prompt).toContain("Give me the status");

478488

expect(prompt).not.toContain("/thinking high");

479489

expect(prompt).not.toContain("/think high");

@@ -515,7 +525,7 @@ describe("trigger handling", () => {

515525

testCase.setup(cfg);

516526

await getReplyFromConfig(BASE_MESSAGE, { isHeartbeat: true }, cfg);

517527518-

const call = runEmbeddedPiAgentMock.mock.calls.at(0)?.[0];

528+

const call = firstMockCallArg(runEmbeddedPiAgentMock, "embedded PI agent");

519529

expect(call?.provider).toBe(testCase.expected.provider);

520530

expect(call?.model).toBe(testCase.expected.model);

521531

}

@@ -573,9 +583,9 @@ describe("trigger handling", () => {

573583

const text = maybeReplyText(res);

574584

expect(text?.startsWith("⚙️ Compacted")).toBe(true);

575585

expect(getCompactEmbeddedPiSessionMock()).toHaveBeenCalledOnce();

576-

expect(getCompactEmbeddedPiSessionMock().mock.calls.at(0)?.[0]?.sessionFile).toContain(

577-

join("agents", "worker1", "sessions"),

578-

);

586+

expect(

587+

firstMockCallArg(getCompactEmbeddedPiSessionMock(), "embedded PI compaction").sessionFile,

588+

).toContain(join("agents", "worker1", "sessions"));

579589

});

580590

});

581591