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

推荐订阅源

WordPress大学
WordPress大学
T
The Blog of Author Tim Ferriss
F
Fortinet All Blogs
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
阮一峰的网络日志
阮一峰的网络日志
The GitHub Blog
The GitHub Blog
Y
Y Combinator Blog
MyScale Blog
MyScale Blog
雷峰网
雷峰网
博客园 - 叶小钗
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
GbyAI
GbyAI
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
博客园 - 三生石上(FineUI控件)
云风的 BLOG
云风的 BLOG
V
V2EX
宝玉的分享
宝玉的分享
酷 壳 – CoolShell
酷 壳 – CoolShell
N
Netflix TechBlog - Medium
Vercel News
Vercel News
美团技术团队
人人都是产品经理
人人都是产品经理
The Cloudflare 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
fix(plugins): preserve tokenjuice runtime rule data · ope...
zqchris · 2026-04-25 · via Recent Commits to openclaw:main

@@ -209,8 +209,15 @@ const defaultStagedRuntimeDepPruneRules = new Map([

209209

["@jimp/plugin-print", { paths: ["src/__image_snapshots__"] }],

210210

["@jimp/plugin-quantize", { paths: ["src/__image_snapshots__"] }],

211211

["@jimp/plugin-threshold", { paths: ["src/__image_snapshots__"] }],

212+

// tokenjuice ships built-in rules as JSON data under `dist/rules/tests/*.json`

213+

// (e.g. `bun-test.json`, `jest.json`, `pytest.json`). These are NOT test

214+

// fixtures — they are the runtime-loaded rule definitions consumed by

215+

// `dist/core/builtin-rules.generated.js`. The global `tests` basename prune

216+

// would strip them, and the plugin then fails to load with

217+

// `Cannot find module '../rules/tests/bun-test.json'`. Keep them staged.

218+

["tokenjuice", { keepDirectories: ["dist/rules/tests"] }],

212219

]);

213-

const runtimeDepsStagingVersion = 6;

220+

const runtimeDepsStagingVersion = 7;

214221

const exactVersionSpecRe = /^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?$/u;

215222216223

function resolveRuntimeDepPruneConfig(params = {}) {

@@ -547,7 +554,7 @@ function isNodeModulesPackageRoot(segments, index) {

547554

return parent?.startsWith("@") === true && segments[index - 2] === "node_modules";

548555

}

549556550-

function pruneDependencyDirectoriesByBasename(depRoot, basenames) {

557+

function pruneDependencyDirectoriesByBasename(depRoot, basenames, keepDirs = new Set()) {

551558

if (!basenames || basenames.length === 0 || !fs.existsSync(depRoot)) {

552559

return;

553560

}

@@ -562,6 +569,15 @@ function pruneDependencyDirectoriesByBasename(depRoot, basenames) {

562569

const fullPath = path.join(currentDir, entry.name);

563570

const segments = relativePathSegments(depRoot, fullPath);

564571

if (basenameSet.has(entry.name) && !isNodeModulesPackageRoot(segments, segments.length - 1)) {

572+

// Per-package opt-out: a pruneRule may keep specific directories that

573+

// would otherwise match a global basename prune (e.g. a data/asset

574+

// directory named `tests/` that is NOT test code). Descend into kept

575+

// directories so their contents are still subject to suffix/pattern

576+

// pruning, but do not remove the directory itself.

577+

if (keepDirs.has(fullPath)) {

578+

queue.push(fullPath);

579+

continue;

580+

}

565581

removePathIfExists(fullPath);

566582

continue;

567583

}

@@ -591,7 +607,12 @@ function pruneStagedInstalledDependencyCargo(nodeModulesDir, depName, pruneConfi

591607

for (const relativePath of pruneRule?.paths ?? []) {

592608

removePathIfExists(path.join(depRoot, relativePath));

593609

}

594-

pruneDependencyDirectoriesByBasename(depRoot, pruneConfig.globalPruneDirectories);

610+

// Resolve per-package keepDirectories (opt-out of global basename prune)

611+

// against depRoot up front so the walk can skip them cheaply.

612+

const keepDirs = new Set(

613+

(pruneRule?.keepDirectories ?? []).map((relativePath) => path.resolve(depRoot, relativePath)),

614+

);

615+

pruneDependencyDirectoriesByBasename(depRoot, pruneConfig.globalPruneDirectories, keepDirs);

595616

pruneDependencyFilesByPatterns(depRoot, pruneConfig.globalPruneFilePatterns);

596617

pruneDependencyFilesBySuffixes(depRoot, pruneConfig.globalPruneSuffixes);

597618

pruneDependencyFilesBySuffixes(depRoot, pruneRule?.suffixes ?? []);