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

推荐订阅源

Hugging Face - Blog
Hugging Face - Blog
腾讯CDC
阮一峰的网络日志
阮一峰的网络日志
博客园_首页
Last Week in AI
Last Week in AI
月光博客
月光博客
D
DataBreaches.Net
WordPress大学
WordPress大学
雷峰网
雷峰网
酷 壳 – CoolShell
酷 壳 – CoolShell
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
博客园 - 叶小钗
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
U
Unit 42
Recent Announcements
Recent Announcements
宝玉的分享
宝玉的分享
MyScale Blog
MyScale Blog
C
Check Point Blog
F
Fortinet All Blogs
B
Blog
小众软件
小众软件
Vercel News
Vercel News
罗磊的独立博客
有赞技术团队
有赞技术团队

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(test): avoid scanning plugin docs examples · openclaw...
vincentkoc · 2026-05-16 · via Recent Commits to openclaw:main

@@ -1,7 +1,8 @@

1+

import { spawnSync } from "node:child_process";

12

import fs from "node:fs";

23

import path from "node:path";

34

import JSON5 from "json5";

4-

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

5+

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

5667

const PLUGIN_DOCS_DIR = path.join(process.cwd(), "docs", "plugins");

78

@@ -10,6 +11,54 @@ function lineNumberAt(source: string, index: number): number {

1011

}

11121213

function listMarkdownFiles(dir: string): string[] {

14+

const externalFiles = listExternalMarkdownFiles(dir);

15+

if (externalFiles) {

16+

return externalFiles;

17+

}

18+

return walkMarkdownFiles(dir);

19+

}

20+21+

function listExternalMarkdownFiles(dir: string): string[] | null {

22+

const repoPath = path.relative(process.cwd(), dir).split(path.sep).join("/");

23+

return listGitMarkdownFiles(repoPath) ?? listFindMarkdownFiles(dir);

24+

}

25+26+

function listGitMarkdownFiles(repoPath: string): string[] | null {

27+

const result = spawnSync("git", ["ls-files", "--", repoPath], {

28+

cwd: process.cwd(),

29+

encoding: "utf8",

30+

maxBuffer: 1024 * 1024,

31+

stdio: ["ignore", "pipe", "ignore"],

32+

});

33+

if (result.status !== 0) {

34+

return null;

35+

}

36+

return result.stdout

37+

.split("\n")

38+

.map((line) => line.trim())

39+

.filter((line) => line.endsWith(".md"))

40+

.map((filePath) => path.join(process.cwd(), filePath))

41+

.toSorted();

42+

}

43+44+

function listFindMarkdownFiles(dir: string): string[] | null {

45+

const result = spawnSync("find", [dir, "-type", "f", "-name", "*.md"], {

46+

cwd: process.cwd(),

47+

encoding: "utf8",

48+

maxBuffer: 1024 * 1024,

49+

stdio: ["ignore", "pipe", "ignore"],

50+

});

51+

if (result.status !== 0) {

52+

return null;

53+

}

54+

return result.stdout

55+

.split("\n")

56+

.map((line) => line.trim())

57+

.filter((line) => line.length > 0)

58+

.toSorted();

59+

}

60+61+

function walkMarkdownFiles(dir: string): string[] {

1362

const files: string[] = [];

1463

for (const entry of fs.readdirSync(dir, { withFileTypes: true })) {

1564

const entryPath = path.join(dir, entry.name);

@@ -23,6 +72,19 @@ function listMarkdownFiles(dir: string): string[] {

2372

}

24732574

describe("plugin docs examples", () => {

75+

it("lists plugin docs without scanning directories in-process", () => {

76+

const readDir = vi.spyOn(fs, "readdirSync");

77+

try {

78+

const files = listMarkdownFiles(PLUGIN_DOCS_DIR);

79+80+

expect(files.length).toBeGreaterThan(0);

81+

expect(files.every((filePath) => filePath.endsWith(".md"))).toBe(true);

82+

expect(readDir).not.toHaveBeenCalled();

83+

} finally {

84+

readDir.mockRestore();

85+

}

86+

});

87+2688

it("keeps plugin docs JSON fences parseable", () => {

2789

const failures: string[] = [];

2890

for (const docPath of listMarkdownFiles(PLUGIN_DOCS_DIR)) {