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

推荐订阅源

S
SegmentFault 最新的问题
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
B
Blog RSS Feed
Y
Y Combinator Blog
T
Tailwind CSS Blog
博客园 - 三生石上(FineUI控件)
J
Java Code Geeks
Stack Overflow Blog
Stack Overflow Blog
aimingoo的专栏
aimingoo的专栏
Jina AI
Jina AI
The GitHub Blog
The GitHub Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
A
About on SuperTechFans
H
Hackread – Cybersecurity News, Data Breaches, AI and More
D
Docker
酷 壳 – CoolShell
酷 壳 – CoolShell
C
Check Point Blog
M
MIT News - Artificial intelligence
Last Week in AI
Last Week in AI
V
V2EX
腾讯CDC
F
Fortinet All Blogs
博客园 - 叶小钗
T
The Blog of Author Tim Ferriss

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: avoid loader count filter allocations · openclaw/op...
steipete · 2026-05-09 · via Recent Commits to openclaw:main
Original file line numberDiff line numberDiff line change

@@ -738,7 +738,9 @@ describe("config io write", () => {

738738

]);

739739

await expect(fs.readFile(configPath, "utf-8")).resolves.toBe(cleanRaw);

740740

const entries = await fs.readdir(path.dirname(configPath));

741-

expect(entries.filter((entry) => entry.includes(".clobbered."))).toHaveLength(1);

741+

expect(

742+

entries.reduce((count, entry) => count + (entry.includes(".clobbered.") ? 1 : 0), 0),

743+

).toBe(1);

742744

expect(warn).toHaveBeenCalledWith(

743745

expect.stringContaining("Config auto-stripped non-JSON prefix:"),

744746

);

@@ -827,7 +829,9 @@ describe("config io write", () => {

827829
828830

await expect(fs.readFile(configPath, "utf-8")).resolves.toBe(originalRaw);

829831

const entries = await fs.readdir(path.dirname(configPath));

830-

expect(entries.filter((entry) => entry.includes(".rejected."))).toHaveLength(1);

832+

expect(

833+

entries.reduce((count, entry) => count + (entry.includes(".rejected.") ? 1 : 0), 0),

834+

).toBe(1);

831835

expect(warn).toHaveBeenCalledWith(expect.stringContaining("Config write rejected:"));

832836

});

833837

});

Original file line numberDiff line numberDiff line change

@@ -42,6 +42,16 @@ function createCustomRootCfg(customRoot: string, defaultAgentId = "ops"): OpenCl

4242

};

4343

}

4444
45+

function countMatching<T>(items: readonly T[], predicate: (item: T) => boolean): number {

46+

let count = 0;

47+

for (const item of items) {

48+

if (predicate(item)) {

49+

count += 1;

50+

}

51+

}

52+

return count;

53+

}

54+
4555

async function resolveTargetsForCustomRoot(home: string, agentIds: string[]) {

4656

const customRoot = path.join(home, "custom-state");

4757

const storePaths = await createAgentSessionStores(customRoot, agentIds);

@@ -186,7 +196,7 @@ describe("resolveAllAgentSessionStoreTargets", () => {

186196

const targets = await resolveAllAgentSessionStoreTargets(cfg, { env: process.env });

187197
188198

expectTargetsToContainStores(targets, storePaths);

189-

expect(targets.filter((target) => target.storePath === storePaths.ops)).toHaveLength(1);

199+

expect(countMatching(targets, (target) => target.storePath === storePaths.ops)).toBe(1);

190200

});

191201

});

192202

@@ -195,7 +205,7 @@ describe("resolveAllAgentSessionStoreTargets", () => {

195205

const { storePaths, targets } = await resolveTargetsForCustomRoot(home, ["ops", "retired"]);

196206
197207

expectTargetsToContainStores(targets, storePaths);

198-

expect(targets.filter((target) => target.storePath === storePaths.ops)).toHaveLength(1);

208+

expect(countMatching(targets, (target) => target.storePath === storePaths.ops)).toBe(1);

199209

});

200210

});

201211
Original file line numberDiff line numberDiff line change

@@ -292,7 +292,12 @@ describe("loader", () => {

292292
293293

const event = createInternalHookEvent("command", "new", "test-session");

294294

await triggerInternalHook(event);

295-

expect(event.messages.filter((message) => message === "reloadable-hook")).toHaveLength(1);

295+

expect(

296+

event.messages.reduce(

297+

(count, message) => count + (message === "reloadable-hook" ? 1 : 0),

298+

0,

299+

),

300+

).toBe(1);

296301

});

297302
298303

it("should support named exports", async () => {

Original file line numberDiff line numberDiff line change

@@ -96,6 +96,16 @@ let cachedBundledMemoryDir = "";

9696
9797

type GlobalHookRunner = NonNullable<ReturnType<typeof getGlobalHookRunner>>;

9898
99+

function countMatching<T>(items: readonly T[], predicate: (item: T) => boolean): number {

100+

let count = 0;

101+

for (const item of items) {

102+

if (predicate(item)) {

103+

count += 1;

104+

}

105+

}

106+

return count;

107+

}

108+
99109

function expectGlobalHookRunner(runner: ReturnType<typeof getGlobalHookRunner>): GlobalHookRunner {

100110

expect(runner).toEqual(expect.objectContaining({ hasHooks: expect.any(Function) }));

101111

if (runner === null) {

@@ -2169,7 +2179,7 @@ module.exports = { id: "throws-after-import", register() {} };`,

21692179
21702180

const event = createInternalHookEvent("gateway", "startup", "gateway:startup");

21712181

await triggerInternalHook(event);

2172-

expect(event.messages.filter((message) => message === "reload-hook-fired")).toHaveLength(1);

2182+

expect(countMatching(event.messages, (message) => message === "reload-hook-fired")).toBe(1);

21732183
21742184

clearInternalHooks();

21752185

});

@@ -4008,7 +4018,7 @@ module.exports = { id: "throws-after-import", register() {} };`,

40084018

});

40094019

} };`,

40104020

assert: (registry: ReturnType<typeof loadOpenClawPlugins>) => {

4011-

expect(registry.channels.filter((entry) => entry.plugin.id === "demo")).toHaveLength(1);

4021+

expect(countMatching(registry.channels, (entry) => entry.plugin.id === "demo")).toBe(1);

40124022

expect(

40134023

registry.channels.find((entry) => entry.plugin.id === "demo")?.plugin.meta?.label,

40144024

).toBe("Demo Duplicate");