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

推荐订阅源

J
Java Code Geeks
腾讯CDC
Jina AI
Jina AI
博客园 - 司徒正美
博客园 - 三生石上(FineUI控件)
Apple Machine Learning Research
Apple Machine Learning Research
GbyAI
GbyAI
WordPress大学
WordPress大学
Hugging Face - Blog
Hugging Face - Blog
T
The Blog of Author Tim Ferriss
小众软件
小众软件
M
MIT News - Artificial intelligence
MyScale Blog
MyScale Blog
D
Docker
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Google DeepMind News
Google DeepMind News
月光博客
月光博客
L
LangChain Blog
F
Fortinet All Blogs
Microsoft Azure Blog
Microsoft Azure Blog
博客园 - Franky
C
Check Point Blog
U
Unit 42
人人都是产品经理
人人都是产品经理

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 extension test assertions · openclaw/opencl...
steipete · 2026-05-11 · via Recent Commits to openclaw:main

@@ -221,15 +221,13 @@ describe("sendMessageMattermost", () => {

221221

accountId: "work",

222222

});

223223224-

expect(result).toMatchObject({

225-

messageId: "post-1",

226-

channelId: "town-square",

227-

receipt: {

228-

primaryPlatformMessageId: "post-1",

229-

platformMessageIds: ["post-1"],

230-

parts: [expect.objectContaining({ platformMessageId: "post-1", kind: "text" })],

231-

},

232-

});

224+

expect(result.messageId).toBe("post-1");

225+

expect(result.channelId).toBe("town-square");

226+

expect(result.receipt.primaryPlatformMessageId).toBe("post-1");

227+

expect(result.receipt.platformMessageIds).toEqual(["post-1"]);

228+

expect(result.receipt.parts).toHaveLength(1);

229+

expect(result.receipt.parts[0]?.platformMessageId).toBe("post-1");

230+

expect(result.receipt.parts[0]?.kind).toBe("text");

233231

expect(mockState.loadConfig).not.toHaveBeenCalled();

234232

});

235233

@@ -259,14 +257,11 @@ describe("sendMessageMattermost", () => {

259257

mediaLocalRoots: ["/tmp/agent-workspace"],

260258

},

261259

);

262-

expect(mockState.uploadMattermostFile).toHaveBeenCalledWith(

263-

{},

264-

expect.objectContaining({

265-

channelId: "town-square",

266-

fileName: "photo.png",

267-

contentType: "image/png",

268-

}),

269-

);

260+

const uploadCall = mockState.uploadMattermostFile.mock.calls[0];

261+

expect(uploadCall?.[0]).toEqual({});

262+

expect(uploadCall?.[1]?.channelId).toBe("town-square");

263+

expect(uploadCall?.[1]?.fileName).toBe("photo.png");

264+

expect(uploadCall?.[1]?.contentType).toBe("image/png");

270265

});

271266272267

it("builds interactive button props when buttons are provided", async () => {

@@ -282,25 +277,16 @@ describe("sendMessageMattermost", () => {

282277

buttons: [[{ callback_data: "mdlprov", text: "Browse providers" }]],

283278

});

284279285-

expect(mockState.createMattermostPost).toHaveBeenCalledWith(

286-

{},

287-

expect.objectContaining({

288-

channelId: "town-square",

289-

message: "Pick a model",

290-

props: expect.objectContaining({

291-

attachments: expect.arrayContaining([

292-

expect.objectContaining({

293-

actions: expect.arrayContaining([

294-

expect.objectContaining({

295-

id: "mdlprov",

296-

name: "Browse providers",

297-

}),

298-

]),

299-

}),

300-

]),

301-

}),

302-

}),

303-

);

280+

const postCall = mockState.createMattermostPost.mock.calls[0];

281+

expect(postCall?.[0]).toEqual({});

282+

expect(postCall?.[1]?.channelId).toBe("town-square");

283+

expect(postCall?.[1]?.message).toBe("Pick a model");

284+

const attachments = postCall?.[1]?.props?.attachments;

285+

expect(Array.isArray(attachments)).toBe(true);

286+

const actions = attachments?.[0]?.actions;

287+

expect(Array.isArray(actions)).toBe(true);

288+

expect(actions?.[0]?.id).toBe("mdlprov");

289+

expect(actions?.[0]?.name).toBe("Browse providers");

304290

});

305291306292

it("resolves a bare Mattermost user id as a DM target before upload", async () => {

@@ -331,12 +317,9 @@ describe("sendMessageMattermost", () => {

331317

expect(dmRetryCall?.[1]).toEqual(["bot-user", userId]);

332318

expect(Object.keys(dmRetryCall?.[2] ?? {})).toEqual(["onRetry"]);

333319

expect(dmRetryCall?.[2]?.onRetry).toBeTypeOf("function");

334-

expect(mockState.uploadMattermostFile).toHaveBeenCalledWith(

335-

{},

336-

expect.objectContaining({

337-

channelId: "dm-channel-1",

338-

}),

339-

);

320+

const uploadCall = mockState.uploadMattermostFile.mock.calls[0];

321+

expect(uploadCall?.[0]).toEqual({});

322+

expect(uploadCall?.[1]?.channelId).toBe("dm-channel-1");

340323

expect(result.channelId).toBe("dm-channel-1");

341324

});

342325

@@ -366,12 +349,9 @@ describe("sendMessageMattermost", () => {

366349367350

expect(mockState.fetchMattermostUser).toHaveBeenCalledWith({}, channelId);

368351

expect(mockState.createMattermostDirectChannelWithRetry).not.toHaveBeenCalled();

369-

expect(mockState.uploadMattermostFile).toHaveBeenCalledWith(

370-

{},

371-

expect.objectContaining({

372-

channelId,

373-

}),

374-

);

352+

const uploadCall = mockState.uploadMattermostFile.mock.calls[0];

353+

expect(uploadCall?.[0]).toEqual({});

354+

expect(uploadCall?.[1]?.channelId).toBe(channelId);

375355

expect(result.channelId).toBe(channelId);

376356

});

377357

});

@@ -495,10 +475,8 @@ describe("sendMessageMattermost user-first resolution", () => {

495475

expect(params.channelId).toBe("dm-channel-id");

496476

expect(res.channelId).toBe("dm-channel-id");

497477

expect(res.messageId).toBe("post-id");

498-

expect(res.receipt).toMatchObject({

499-

primaryPlatformMessageId: "post-id",

500-

platformMessageIds: ["post-id"],

501-

});

478+

expect(res.receipt.primaryPlatformMessageId).toBe("post-id");

479+

expect(res.receipt.platformMessageIds).toEqual(["post-id"]);

502480

});

503481504482

it("falls back to channel id when user lookup returns 404", async () => {

@@ -589,11 +567,13 @@ describe("sendMessageMattermost user-first resolution", () => {

589567

dmRetryOptions: retryOptions,

590568

});

591569592-

expect(mockState.createMattermostDirectChannelWithRetry).toHaveBeenCalledWith(

593-

{},

594-

["bot-id", userId],

595-

expect.objectContaining(retryOptions),

596-

);

570+

const retryCall = mockState.createMattermostDirectChannelWithRetry.mock.calls[0];

571+

expect(retryCall?.[0]).toEqual({});

572+

expect(retryCall?.[1]).toEqual(["bot-id", userId]);

573+

expect(retryCall?.[2]?.maxRetries).toBe(retryOptions.maxRetries);

574+

expect(retryCall?.[2]?.initialDelayMs).toBe(retryOptions.initialDelayMs);

575+

expect(retryCall?.[2]?.maxDelayMs).toBe(retryOptions.maxDelayMs);

576+

expect(retryCall?.[2]?.timeoutMs).toBe(retryOptions.timeoutMs);

597577

});

598578599579

it("uses dmChannelRetry from account config when opts.dmRetryOptions not provided", async () => {

@@ -615,16 +595,13 @@ describe("sendMessageMattermost user-first resolution", () => {

615595616596

await sendMessageMattermost(`user:${userId}`, "hello", { cfg: TEST_CFG });

617597618-

expect(mockState.createMattermostDirectChannelWithRetry).toHaveBeenCalledWith(

619-

{},

620-

["bot-id", userId],

621-

expect.objectContaining({

622-

maxRetries: 4,

623-

initialDelayMs: 2000,

624-

maxDelayMs: 8000,

625-

timeoutMs: 15000,

626-

}),

627-

);

598+

const retryCall = mockState.createMattermostDirectChannelWithRetry.mock.calls[0];

599+

expect(retryCall?.[0]).toEqual({});

600+

expect(retryCall?.[1]).toEqual(["bot-id", userId]);

601+

expect(retryCall?.[2]?.maxRetries).toBe(4);

602+

expect(retryCall?.[2]?.initialDelayMs).toBe(2000);

603+

expect(retryCall?.[2]?.maxDelayMs).toBe(8000);

604+

expect(retryCall?.[2]?.timeoutMs).toBe(15000);

628605

});

629606630607

it("opts.dmRetryOptions overrides provided fields and preserves account defaults", async () => {

@@ -652,17 +629,11 @@ describe("sendMessageMattermost user-first resolution", () => {

652629

dmRetryOptions: overrideOptions,

653630

});

654631655-

expect(mockState.createMattermostDirectChannelWithRetry).toHaveBeenCalledWith(

656-

{},

657-

["bot-id", userId],

658-

expect.objectContaining(overrideOptions),

659-

);

660-

expect(mockState.createMattermostDirectChannelWithRetry).toHaveBeenCalledWith(

661-

{},

662-

["bot-id", userId],

663-

expect.objectContaining({

664-

initialDelayMs: 1000,

665-

}),

666-

);

632+

const retryCall = mockState.createMattermostDirectChannelWithRetry.mock.calls[0];

633+

expect(retryCall?.[0]).toEqual({});

634+

expect(retryCall?.[1]).toEqual(["bot-id", userId]);

635+

expect(retryCall?.[2]?.maxRetries).toBe(overrideOptions.maxRetries);

636+

expect(retryCall?.[2]?.timeoutMs).toBe(overrideOptions.timeoutMs);

637+

expect(retryCall?.[2]?.initialDelayMs).toBe(1000);

667638

});

668639

});