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

推荐订阅源

WordPress大学
WordPress大学
云风的 BLOG
云风的 BLOG
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
D
Docker
H
Help Net Security
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Microsoft Azure Blog
Microsoft Azure Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
T
Tailwind CSS Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
月光博客
月光博客
C
Check Point Blog
S
SegmentFault 最新的问题
T
The Blog of Author Tim Ferriss
J
Java Code Geeks
M
MIT News - Artificial intelligence
B
Blog RSS Feed
MyScale Blog
MyScale Blog
大猫的无限游戏
大猫的无限游戏
Hugging Face - Blog
Hugging Face - Blog
腾讯CDC
美团技术团队
I
InfoQ
Blog — PlanetScale
Blog — PlanetScale

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 reply payload assertions · openclaw/opencla...
steipete · 2026-05-11 · via Recent Commits to openclaw:main

@@ -15,6 +15,15 @@ const baseParams = {

1515

replyToMode: "off" as const,

1616

};

171718+

function expectFields(value: unknown, expected: Record<string, unknown>): void {

19+

expect(value).toBeTypeOf("object");

20+

expect(value).not.toBeNull();

21+

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

22+

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

23+

expect(record[key], key).toEqual(expectedValue);

24+

}

25+

}

26+1827

async function expectSameTargetRepliesDelivered(params: { provider: string; to: string }) {

1928

const { replyPayloads } = await buildReplyPayloads({

2029

...baseParams,

@@ -68,11 +77,11 @@ describe("buildReplyPayloads media filter integration", () => {

6877

});

69787079

expect(replyPayloads).toHaveLength(1);

71-

expect(replyPayloads[0]).toMatchObject({

80+

expectFields(replyPayloads[0], {

7281

text: "⚠️ API rate limit reached.",

7382

replyToId: "msg-1",

7483

});

75-

expect(getReplyPayloadMetadata(replyPayloads[0])).toMatchObject({

84+

expectFields(getReplyPayloadMetadata(replyPayloads[0]), {

7685

deliverDespiteSourceReplySuppression: true,

7786

});

7887

});

@@ -118,7 +127,7 @@ describe("buildReplyPayloads media filter integration", () => {

118127

});

119128120129

expect(replyPayloads).toHaveLength(1);

121-

expect(replyPayloads[0]).toMatchObject({

130+

expectFields(replyPayloads[0], {

122131

text: "hello",

123132

mediaUrl: undefined,

124133

mediaUrls: undefined,

@@ -143,13 +152,13 @@ describe("buildReplyPayloads media filter integration", () => {

143152

});

144153145154

expect(replyPayloads).toHaveLength(2);

146-

expect(replyPayloads[0]).toMatchObject({

155+

expectFields(replyPayloads[0], {

147156

text: "keep text",

148157

mediaUrl: undefined,

149158

mediaUrls: undefined,

150159

audioAsVoice: false,

151160

});

152-

expect(replyPayloads[1]).toMatchObject({

161+

expectFields(replyPayloads[1], {

153162

text: "keep second",

154163

});

155164

});

@@ -174,7 +183,7 @@ describe("buildReplyPayloads media filter integration", () => {

174183

});

175184176185

expect(replyPayloads).toHaveLength(1);

177-

expect(replyPayloads[0]).toMatchObject({

186+

expectFields(replyPayloads[0], {

178187

text: "hello world!",

179188

mediaUrl: "file:///tmp/photo.jpg",

180189

});

@@ -287,7 +296,7 @@ describe("buildReplyPayloads media filter integration", () => {

287296

});

288297289298

expect(replyPayloads).toHaveLength(1);

290-

expect(replyPayloads[0]).toMatchObject({

299+

expectFields(replyPayloads[0], {

291300

text: "photo",

292301

mediaUrl: undefined,

293302

mediaUrls: undefined,

@@ -407,7 +416,7 @@ describe("buildReplyPayloads media filter integration", () => {

407416

});

408417409418

expect(replyPayloads).toHaveLength(1);

410-

expect(replyPayloads[0]).toMatchObject({

419+

expectFields(replyPayloads[0], {

411420

text: "caption",

412421

mediaUrl: undefined,

413422

mediaUrls: undefined,

@@ -492,7 +501,7 @@ describe("buildReplyPayloads media filter integration", () => {

492501

});

493502494503

expect(replyPayloads).toHaveLength(1);

495-

expect(replyPayloads[0]).toMatchObject({

504+

expectFields(replyPayloads[0], {

496505

mediaUrl: "/tmp/generated.png",

497506

text: undefined,

498507

});

@@ -541,7 +550,7 @@ describe("buildReplyPayloads media filter integration", () => {

541550

});

542551543552

expect(replyPayloads).toHaveLength(1);

544-

expect(replyPayloads[0]).toMatchObject({

553+

expectFields(replyPayloads[0], {

545554

text: "Agent couldn't generate a response. Please try again.",

546555

isError: true,

547556

});

@@ -565,7 +574,7 @@ describe("buildReplyPayloads media filter integration", () => {

565574

});

566575567576

expect(replyPayloads).toHaveLength(1);

568-

expect(replyPayloads[0]).toMatchObject({

577+

expectFields(replyPayloads[0], {

569578

text: undefined,

570579

mediaUrl: "file:///tmp/voice.opus",

571580

audioAsVoice: true,

@@ -604,7 +613,7 @@ describe("buildReplyPayloads media filter integration", () => {

604613

});

605614606615

expect(replyPayloads).toHaveLength(1);

607-

expect(replyPayloads[0]).toMatchObject({

616+

expectFields(replyPayloads[0], {

608617

text: "Here you go",

609618

mediaUrl: "https://example.com/chart.png",

610619

mediaUrls: ["https://example.com/chart.png"],

@@ -619,7 +628,7 @@ describe("buildReplyPayloads media filter integration", () => {

619628

});

620629621630

expect(replyPayloads).toHaveLength(1);

622-

expect(replyPayloads[0]).toMatchObject({

631+

expectFields(replyPayloads[0], {

623632

text: "Look now",

624633

mediaUrl: "https://example.com/chart.png",

625634

mediaUrls: ["https://example.com/chart.png"],

@@ -635,7 +644,7 @@ describe("buildReplyPayloads media filter integration", () => {

635644

});

636645637646

expect(replyPayloads).toHaveLength(1);

638-

expect(replyPayloads[0]).toMatchObject({

647+

expectFields(replyPayloads[0], {

639648

text,

640649

});

641650

expect(replyPayloads[0]?.mediaUrl).toBeUndefined();