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

推荐订阅源

奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Blog — PlanetScale
Blog — PlanetScale
小众软件
小众软件
F
Fortinet All Blogs
博客园 - 叶小钗
博客园_首页
D
DataBreaches.Net
Apple Machine Learning Research
Apple Machine Learning Research
U
Unit 42
爱范儿
爱范儿
aimingoo的专栏
aimingoo的专栏
博客园 - Franky
Martin Fowler
Martin Fowler
酷 壳 – CoolShell
酷 壳 – CoolShell
The Cloudflare Blog
A
About on SuperTechFans
Google DeepMind News
Google DeepMind News
Microsoft Security Blog
Microsoft Security Blog
IT之家
IT之家
M
MIT News - Artificial intelligence
有赞技术团队
有赞技术团队
博客园 - 【当耐特】
S
SegmentFault 最新的问题
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: tighten media background assertions · openclaw/open...
steipete · 2026-05-10 · via Recent Commits to openclaw:main

@@ -79,6 +79,25 @@ type CompletionFixtureParams = {

7979

taskLabel: string;

8080

};

818182+

function requireRecord(value: unknown, label: string): Record<string, unknown> {

83+

if (!value || typeof value !== "object" || Array.isArray(value)) {

84+

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

85+

}

86+

return value as Record<string, unknown>;

87+

}

88+89+

function requireMockFirstParam(mock: unknown, label: string): Record<string, unknown> {

90+

const first = (mock as { mock?: { calls?: unknown[][] } }).mock?.calls?.[0]?.[0];

91+

return requireRecord(first, label);

92+

}

93+94+

function requireRecordArray(value: unknown, label: string): Record<string, unknown>[] {

95+

if (!Array.isArray(value)) {

96+

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

97+

}

98+

return value.map((entry, index) => requireRecord(entry, `${label}[${index}]`));

99+

}

100+82101

export function createMediaCompletionFixture({

83102

directSend,

84103

mediaUrls,

@@ -125,26 +144,26 @@ export function expectQueuedTaskRun({

125144

sourceId,

126145

progressSummary,

127146

}: QueuedTaskExpectation): void {

128-

expect(taskExecutorMocks.createRunningTaskRun).toHaveBeenCalledWith(

129-

expect.objectContaining({

130-

taskKind,

131-

sourceId,

132-

progressSummary,

133-

}),

147+

const params = requireMockFirstParam(

148+

taskExecutorMocks.createRunningTaskRun,

149+

"createRunningTaskRun params",

134150

);

151+

expect(params.taskKind).toBe(taskKind);

152+

expect(params.sourceId).toBe(sourceId);

153+

expect(params.progressSummary).toBe(progressSummary);

135154

}

136155137156

export function expectRecordedTaskProgress({

138157

taskExecutorMocks,

139158

runId,

140159

progressSummary,

141160

}: ProgressExpectation): void {

142-

expect(taskExecutorMocks.recordTaskRunProgressByRunId).toHaveBeenCalledWith(

143-

expect.objectContaining({

144-

runId,

145-

progressSummary,

146-

}),

161+

const params = requireMockFirstParam(

162+

taskExecutorMocks.recordTaskRunProgressByRunId,

163+

"recordTaskRunProgressByRunId params",

147164

);

165+

expect(params.runId).toBe(runId);

166+

expect(params.progressSummary).toBe(progressSummary);

148167

}

149168150169

export function expectDirectMediaSend({

@@ -155,15 +174,12 @@ export function expectDirectMediaSend({

155174

content,

156175

mediaUrls,

157176

}: DirectSendExpectation): void {

158-

expect(sendMessageMock).toHaveBeenCalledWith(

159-

expect.objectContaining({

160-

channel,

161-

to,

162-

threadId,

163-

content,

164-

mediaUrls,

165-

}),

166-

);

177+

const params = requireMockFirstParam(sendMessageMock, "sendMessage params");

178+

expect(params.channel).toBe(channel);

179+

expect(params.to).toBe(to);

180+

expect(params.threadId).toBe(threadId);

181+

expect(params.content).toBe(content);

182+

expect(params.mediaUrls).toEqual(mediaUrls);

167183

}

168184169185

export function expectFallbackMediaAnnouncement({

@@ -176,24 +192,24 @@ export function expectFallbackMediaAnnouncement({

176192

resultMediaPath,

177193

mediaUrls,

178194

}: FallbackAnnouncementExpectation): void {

179-

expect(deliverAnnouncementMock).toHaveBeenCalledWith(

180-

expect.objectContaining({

181-

requesterSessionKey,

182-

requesterOrigin: expect.objectContaining({

183-

channel,

184-

to,

185-

}),

186-

expectsCompletionMessage: true,

187-

internalEvents: expect.arrayContaining([

188-

expect.objectContaining({

189-

source,

190-

announceType,

191-

status: "ok",

192-

result: expect.stringContaining(resultMediaPath),

193-

mediaUrls,

194-

replyInstruction: expect.stringContaining("Tell the user"),

195-

}),

196-

]),

197-

}),

195+

const params = requireMockFirstParam(

196+

deliverAnnouncementMock,

197+

"deliverSubagentAnnouncement params",

198+

);

199+

expect(params.requesterSessionKey).toBe(requesterSessionKey);

200+

const requesterOrigin = requireRecord(params.requesterOrigin, "requesterOrigin");

201+

expect(requesterOrigin.channel).toBe(channel);

202+

expect(requesterOrigin.to).toBe(to);

203+

expect(params.expectsCompletionMessage).toBe(true);

204+205+

const event = requireRecordArray(params.internalEvents, "internalEvents").find(

206+

(candidate) => candidate.source === source && candidate.announceType === announceType,

198207

);

208+

if (!event) {

209+

throw new Error(`expected internal event ${source}/${announceType}`);

210+

}

211+

expect(event.status).toBe("ok");

212+

expect(String(event.result)).toContain(resultMediaPath);

213+

expect(event.mediaUrls).toEqual(mediaUrls);

214+

expect(String(event.replyInstruction)).toContain("Tell the user");

199215

}