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

推荐订阅源

博客园_首页
H
Help Net Security
腾讯CDC
宝玉的分享
宝玉的分享
H
Hackread – Cybersecurity News, Data Breaches, AI and More
L
LangChain Blog
爱范儿
爱范儿
T
The Blog of Author Tim Ferriss
J
Java Code Geeks
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
MyScale Blog
MyScale Blog
Engineering at Meta
Engineering at Meta
N
Netflix TechBlog - Medium
D
Docker
V
V2EX
Last Week in AI
Last Week in AI
G
Google Developers Blog
IT之家
IT之家
C
Check Point Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
人人都是产品经理
人人都是产品经理
博客园 - 叶小钗
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
博客园 - 聂微东

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
perf: speed up bundled metadata test paths · openclaw/ope...
steipete · 2026-05-02 · via Recent Commits to openclaw:main

@@ -29,6 +29,7 @@ const CURRENT_MODULE_PATH = fileURLToPath(import.meta.url);

2929

const RUNNING_FROM_BUILT_ARTIFACT =

3030

CURRENT_MODULE_PATH.includes(`${path.sep}dist${path.sep}`) ||

3131

CURRENT_MODULE_PATH.includes(`${path.sep}dist-runtime${path.sep}`);

32+

const DEFAULT_ROOT_METADATA_CACHE = new Map<string, readonly BundledPluginMetadata[]>();

32333334

type BundledPluginPathPair = {

3435

source: string;

@@ -82,12 +83,10 @@ function resolveBundledPluginLookupParams(params: { rootDir: string; scanDir?: s

8283

}

83848485

function collectBundledPluginMetadata(

85-

packageRoot: string,

86+

resolvedScanDir: string | undefined,

8687

includeChannelConfigs: boolean,

8788

includeSyntheticChannelConfigs: boolean,

88-

scanDir?: string,

8989

): readonly BundledPluginMetadata[] {

90-

const resolvedScanDir = resolveBundledPluginMetadataScanDir(packageRoot, scanDir);

9190

if (!resolvedScanDir || !fs.existsSync(resolvedScanDir)) {

9291

return [];

9392

}

@@ -183,22 +182,43 @@ export function listBundledPluginMetadata(params?: {

183182

}): readonly BundledPluginMetadata[] {

184183

const rootDir = path.resolve(params?.rootDir ?? OPENCLAW_PACKAGE_ROOT);

185184

const scanDir = params?.scanDir ? path.resolve(params.scanDir) : undefined;

185+

const resolvedScanDir = resolveBundledPluginMetadataScanDir(rootDir, scanDir);

186186

const includeChannelConfigs = params?.includeChannelConfigs ?? !RUNNING_FROM_BUILT_ARTIFACT;

187187

const includeSyntheticChannelConfigs =

188188

params?.includeSyntheticChannelConfigs ?? includeChannelConfigs;

189-

return Object.freeze(

189+

const cacheKey =

190+

!params?.rootDir && !scanDir

191+

? JSON.stringify({

192+

resolvedScanDir,

193+

includeChannelConfigs,

194+

includeSyntheticChannelConfigs,

195+

})

196+

: undefined;

197+

const cached = cacheKey ? DEFAULT_ROOT_METADATA_CACHE.get(cacheKey) : undefined;

198+

if (cached) {

199+

return cached;

200+

}

201+

const metadata = Object.freeze(

190202

collectBundledPluginMetadata(

191-

rootDir,

203+

resolvedScanDir,

192204

includeChannelConfigs,

193205

includeSyntheticChannelConfigs,

194-

scanDir,

195206

),

196207

);

208+

if (cacheKey) {

209+

DEFAULT_ROOT_METADATA_CACHE.set(cacheKey, metadata);

210+

}

211+

return metadata;

197212

}

198213199214

export function findBundledPluginMetadataById(

200215

pluginId: string,

201-

params?: { rootDir?: string; scanDir?: string },

216+

params?: {

217+

rootDir?: string;

218+

scanDir?: string;

219+

includeChannelConfigs?: boolean;

220+

includeSyntheticChannelConfigs?: boolean;

221+

},

202222

): BundledPluginMetadata | undefined {

203223

return listBundledPluginMetadata(params).find((entry) => entry.manifest.id === pluginId);

204224

}

@@ -208,13 +228,14 @@ export function resolveBundledPluginWorkspaceSourcePath(params: {

208228

scanDir?: string;

209229

pluginId: string;

210230

}): string | null {

211-

const metadata = findBundledPluginMetadataById(

212-

params.pluginId,

213-

resolveBundledPluginLookupParams({

231+

const metadata = findBundledPluginMetadataById(params.pluginId, {

232+

...resolveBundledPluginLookupParams({

214233

rootDir: params.rootDir,

215234

scanDir: params.scanDir,

216235

}),

217-

);

236+

includeChannelConfigs: false,

237+

includeSyntheticChannelConfigs: false,

238+

});

218239

if (!metadata) {

219240

return null;

220241

}

@@ -275,13 +296,14 @@ export function resolveBundledPluginRepoEntryPath(params: {

275296

preferBuilt?: boolean;

276297

scanDir?: string;

277298

}): string | null {

278-

const metadata = findBundledPluginMetadataById(

279-

params.pluginId,

280-

resolveBundledPluginLookupParams({

299+

const metadata = findBundledPluginMetadataById(params.pluginId, {

300+

...resolveBundledPluginLookupParams({

281301

rootDir: params.rootDir,

282302

scanDir: params.scanDir,

283303

}),

284-

);

304+

includeChannelConfigs: false,

305+

includeSyntheticChannelConfigs: false,

306+

});

285307

if (!metadata) {

286308

return null;

287309

}