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

推荐订阅源

aimingoo的专栏
aimingoo的专栏
腾讯CDC
Y
Y Combinator Blog
L
LangChain Blog
B
Blog
U
Unit 42
P
Proofpoint News Feed
G
Google Developers Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
博客园 - 【当耐特】
WordPress大学
WordPress大学
月光博客
月光博客
Vercel News
Vercel News
雷峰网
雷峰网
T
The Blog of Author Tim Ferriss
MyScale Blog
MyScale Blog
大猫的无限游戏
大猫的无限游戏
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
酷 壳 – CoolShell
酷 壳 – CoolShell
Blog — PlanetScale
Blog — PlanetScale
博客园 - 司徒正美
云风的 BLOG
云风的 BLOG
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
博客园 - 叶小钗

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
fix: deliver generated media as structured attachments · ...
steipete · 2026-05-15 · via Recent Commits to openclaw:main

@@ -39,6 +39,71 @@ function hasNonEmptyStringArray(value: unknown): boolean {

3939

return Array.isArray(value) && value.some(hasNonEmptyString);

4040

}

414142+

function collectStringValues(value: unknown, output: Set<string>) {

43+

if (typeof value === "string" && value.trim()) {

44+

output.add(value.trim());

45+

return;

46+

}

47+

if (!Array.isArray(value)) {

48+

return;

49+

}

50+

for (const entry of value) {

51+

if (typeof entry === "string" && entry.trim()) {

52+

output.add(entry.trim());

53+

}

54+

}

55+

}

56+57+

function collectMediaUrlsFromRecord(record: Record<string, unknown>, output: Set<string>) {

58+

collectStringValues(record.mediaUrl, output);

59+

collectStringValues(record.mediaUrls, output);

60+

collectStringValues(record.path, output);

61+

collectStringValues(record.url, output);

62+

collectStringValues(record.filePath, output);

63+

const attachments = record.attachments;

64+

if (Array.isArray(attachments)) {

65+

for (const attachment of attachments) {

66+

if (attachment && typeof attachment === "object" && !Array.isArray(attachment)) {

67+

collectMediaUrlsFromRecord(attachment as Record<string, unknown>, output);

68+

}

69+

}

70+

}

71+

}

72+73+

export function collectDeliveredMediaUrls(result: AgentDeliveryEvidence): string[] {

74+

const urls = new Set<string>();

75+

if (Array.isArray(result.payloads)) {

76+

for (const payload of result.payloads) {

77+

if (payload && typeof payload === "object" && !Array.isArray(payload)) {

78+

collectMediaUrlsFromRecord(payload as Record<string, unknown>, urls);

79+

}

80+

}

81+

}

82+

collectStringValues(result.messagingToolSentMediaUrls, urls);

83+

if (Array.isArray(result.messagingToolSentTargets)) {

84+

for (const target of result.messagingToolSentTargets) {

85+

if (target && typeof target === "object" && !Array.isArray(target)) {

86+

collectMediaUrlsFromRecord(target as Record<string, unknown>, urls);

87+

}

88+

}

89+

}

90+

return Array.from(urls);

91+

}

92+93+

export function hasDeliveredExpectedMedia(

94+

result: AgentDeliveryEvidence,

95+

expectedMediaUrls: readonly string[],

96+

): boolean {

97+

const expected = Array.from(

98+

new Set(expectedMediaUrls.map((url) => url.trim()).filter((url) => url.length > 0)),

99+

);

100+

if (expected.length === 0) {

101+

return true;

102+

}

103+

const delivered = new Set(collectDeliveredMediaUrls(result));

104+

return expected.every((url) => delivered.has(url));

105+

}

106+42107

function hasPositiveNumber(value: unknown): boolean {

43108

return typeof value === "number" && Number.isFinite(value) && value > 0;

44109

}