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

推荐订阅源

GbyAI
GbyAI
Y
Y Combinator Blog
Martin Fowler
Martin Fowler
D
Docker
N
Netflix TechBlog - Medium
酷 壳 – CoolShell
酷 壳 – CoolShell
WordPress大学
WordPress大学
L
LangChain Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
博客园 - 三生石上(FineUI控件)
博客园_首页
量子位
罗磊的独立博客
Blog — PlanetScale
Blog — PlanetScale
云风的 BLOG
云风的 BLOG
Microsoft Azure Blog
Microsoft Azure Blog
宝玉的分享
宝玉的分享
Apple Machine Learning Research
Apple Machine Learning Research
D
DataBreaches.Net
I
InfoQ
Engineering at Meta
Engineering at Meta
The Cloudflare Blog
H
Help Net Security
V
V2EX

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 task flow audit assertions · openclaw/openc...
steipete · 2026-05-10 · via Recent Commits to openclaw:main

@@ -1,7 +1,11 @@

11

import { afterEach, describe, expect, it } from "vitest";

22

import { withOpenClawTestState } from "../test-utils/openclaw-test-state.js";

33

import { createRunningTaskRun } from "./task-executor.js";

4-

import { listTaskFlowAuditFindings } from "./task-flow-registry.audit.js";

4+

import {

5+

listTaskFlowAuditFindings,

6+

type TaskFlowAuditCode,

7+

type TaskFlowAuditFinding,

8+

} from "./task-flow-registry.audit.js";

59

import {

610

createManagedTaskFlow,

711

resetTaskFlowRegistryForTests,

@@ -15,6 +19,21 @@ import {

15191620

const ORIGINAL_STATE_DIR = process.env.OPENCLAW_STATE_DIR;

172122+

function requireFinding(

23+

findings: TaskFlowAuditFinding[],

24+

code: TaskFlowAuditCode,

25+

flowId?: string,

26+

): TaskFlowAuditFinding {

27+

const finding = findings.find(

28+

(candidate) =>

29+

candidate.code === code && (flowId === undefined || candidate.flow?.flowId === flowId),

30+

);

31+

if (!finding) {

32+

throw new Error(`Expected ${code} finding${flowId ? ` for ${flowId}` : ""}`);

33+

}

34+

return finding;

35+

}

36+1837

async function withTaskFlowAuditStateDir(run: (root: string) => Promise<void>): Promise<void> {

1938

await withOpenClawTestState(

2039

{

@@ -58,13 +77,11 @@ describe("task-flow-registry audit", () => {

5877

},

5978

});

607961-

expect(listTaskFlowAuditFindings()).toEqual([

62-

expect.objectContaining({

63-

severity: "error",

64-

code: "restore_failed",

65-

detail: expect.stringContaining("boom"),

66-

}),

67-

]);

80+

const findings = listTaskFlowAuditFindings();

81+

expect(findings).toHaveLength(1);

82+

expect(findings[0]?.severity).toBe("error");

83+

expect(findings[0]?.code).toBe("restore_failed");

84+

expect(findings[0]?.detail).toContain("boom");

6885

});

69867087

it("clears restore-failed findings after a clean reset and restore", () => {

@@ -77,11 +94,9 @@ describe("task-flow-registry audit", () => {

7794

},

7895

});

799680-

expect(listTaskFlowAuditFindings()).toEqual([

81-

expect.objectContaining({

82-

code: "restore_failed",

83-

}),

84-

]);

97+

const findings = listTaskFlowAuditFindings();

98+

expect(findings).toHaveLength(1);

99+

expect(findings[0]?.code).toBe("restore_failed");

8510086101

resetTaskFlowRegistryForTests({ persist: false });

87102

configureTaskFlowRegistryRuntime({

@@ -124,17 +139,11 @@ describe("task-flow-registry audit", () => {

124139

});

125140126141

const findings = listTaskFlowAuditFindings({ now: 31 * 60_000 });

127-

expect(findings).toEqual(

128-

expect.arrayContaining([

129-

expect.objectContaining({

130-

code: "missing_linked_tasks",

131-

flow: expect.objectContaining({ flowId: running.flowId }),

132-

}),

133-

expect.objectContaining({

134-

code: "blocked_task_missing",

135-

flow: expect.objectContaining({ flowId: blocked.flowId }),

136-

}),

137-

]),

142+

expect(requireFinding(findings, "missing_linked_tasks", running.flowId).flow?.flowId).toBe(

143+

running.flowId,

144+

);

145+

expect(requireFinding(findings, "blocked_task_missing", blocked.flowId).flow?.flowId).toBe(

146+

blocked.flowId,

138147

);

139148

});

140149

});

@@ -162,14 +171,13 @@ describe("task-flow-registry audit", () => {

162171

lastEventAt: 1,

163172

});

164173165-

expect(listTaskFlowAuditFindings({ now: 31 * 60_000 })).not.toEqual(

166-

expect.arrayContaining([

167-

expect.objectContaining({

168-

code: "missing_linked_tasks",

169-

flow: expect.objectContaining({ flowId: flow.flowId }),

170-

}),

171-

]),

172-

);

174+

const findings = listTaskFlowAuditFindings({ now: 31 * 60_000 });

175+

expect(

176+

findings.some(

177+

(finding) =>

178+

finding.code === "missing_linked_tasks" && finding.flow?.flowId === flow.flowId,

179+

),

180+

).toBe(false);

173181

});

174182

});

175183

@@ -191,13 +199,9 @@ describe("task-flow-registry audit", () => {

191199

),

192200

).toBeUndefined();

193201194-

expect(listTaskFlowAuditFindings({ now: now + 26 * 60_000 })).toEqual(

195-

expect.arrayContaining([

196-

expect.objectContaining({

197-

code: "missing_linked_tasks",

198-

flow: expect.objectContaining({ flowId: flow.flowId }),

199-

}),

200-

]),

202+

const staleFindings = listTaskFlowAuditFindings({ now: now + 26 * 60_000 });

203+

expect(requireFinding(staleFindings, "missing_linked_tasks", flow.flowId).flow?.flowId).toBe(

204+

flow.flowId,

201205

);

202206

});

203207

});

@@ -214,14 +218,8 @@ describe("task-flow-registry audit", () => {

214218

updatedAt: 100,

215219

});

216220217-

expect(listTaskFlowAuditFindings({ now: 6 * 60_000 })).toEqual(

218-

expect.arrayContaining([

219-

expect.objectContaining({

220-

code: "cancel_stuck",

221-

flow: expect.objectContaining({ flowId: flow.flowId }),

222-

}),

223-

]),

224-

);

221+

const findings = listTaskFlowAuditFindings({ now: 6 * 60_000 });

222+

expect(requireFinding(findings, "cancel_stuck", flow.flowId).flow?.flowId).toBe(flow.flowId);

225223

});

226224

});

227225

});