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

推荐订阅源

K
Kaspersky official blog
T
Threat Research - Cisco Blogs
N
News and Events Feed by Topic
Hacker News: Ask HN
Hacker News: Ask HN
Project Zero
Project Zero
Application and Cybersecurity Blog
Application and Cybersecurity Blog
博客园 - 叶小钗
Security Latest
Security Latest
Spread Privacy
Spread Privacy
aimingoo的专栏
aimingoo的专栏
N
News and Events Feed by Topic
Webroot Blog
Webroot Blog
U
Unit 42
Cyberwarzone
Cyberwarzone
小众软件
小众软件
Scott Helme
Scott Helme
Engineering at Meta
Engineering at Meta
Microsoft Security Blog
Microsoft Security Blog
T
The Blog of Author Tim Ferriss
A
About on SuperTechFans
爱范儿
爱范儿
S
Schneier on Security
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Schneier on Security
Schneier on Security
Latest news
Latest news
GbyAI
GbyAI
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Simon Willison's Weblog
Simon Willison's Weblog
The Register - Security
The Register - Security
WordPress大学
WordPress大学
博客园_首页
Blog — PlanetScale
Blog — PlanetScale
PCI Perspectives
PCI Perspectives
Jina AI
Jina AI
AI
AI
NISL@THU
NISL@THU
I
Intezer
G
GRAHAM CLULEY
B
Blog
S
Secure Thoughts
IT之家
IT之家
宝玉的分享
宝玉的分享
Recent Announcements
Recent Announcements
Y
Y Combinator Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
酷 壳 – CoolShell
酷 壳 – CoolShell
有赞技术团队
有赞技术团队
V2EX - 技术
V2EX - 技术
Recorded Future
Recorded Future
Hacker News - Newest:
Hacker News - Newest: "LLM"

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: trim doctor command hotspots · openclaw/openclaw@c66f16a test: isolate agent auth and spawn hotspots · openclaw/openclaw@9285935 test: stabilize MCP startup disposal race · openclaw/openclaw@dd9d2eb test: merge browser contract server suites · openclaw/openclaw@5817a76 test: narrow ollama provider discovery setup · openclaw/openclaw@a0d9598 build: declare qa-lab aimock runtime dependency · openclaw/openclaw@24431e5 test: speed up safe-bins exec harness · openclaw/openclaw@ee856ab test: preserve tool helpers in embedded runner mocks · openclaw/openclaw@acd86a0 refactor: move memory embeddings into provider plugins · openclaw/openclaw@77e6e4c test: reuse system-run temp fixtures · openclaw/openclaw@7e9ff0f test: trim hotspot wait overhead · openclaw/openclaw@12a59b0 Check: avoid duplicate boundary prep · openclaw/openclaw@baf11b8 test: reduce hotspot fixture overhead · openclaw/openclaw@3a59edd feat(ui): overhaul settings and slash command UX (#67819) thanks @Bun… · openclaw/openclaw@2cfb660 QA Matrix: exit cleanly on failure · openclaw/openclaw@42805d2 QA Matrix: isolate scenario coverage · openclaw/openclaw@7e659e1 Matrix: refresh crypto bootstrap state · openclaw/openclaw@94081d8 QA Lab: add provider registry · openclaw/openclaw@bb7e982 Matrix: add plugin changelog · openclaw/openclaw@4acab55 test: trim more hotspot overhead · openclaw/openclaw@f485311 test: trim remaining hotspot tests · openclaw/openclaw@6ba8626 test: narrow hotspot mocks · openclaw/openclaw@dbc8179 test: isolate gemini embedding request helpers · openclaw/openclaw@cd330f5 test: trim memory and mcp hotspots · openclaw/openclaw@fd48dfa test: slim provider registry mocks · openclaw/openclaw@2e08c77 test: harden Parallels update smoke · openclaw/openclaw@1a98090 feat: default Anthropic to Opus 4.7 · openclaw/openclaw@628b454 fix: harden node-host shell payload mutability checks · openclaw/openclaw@75c551e fix: land node-host approval binding for native binaries (#66731) (th… · openclaw/openclaw@29919bb CI: add daily schedule to CodeQL workflow (#67645) · openclaw/openclaw@69d25f5 fix(gateway): capture config hash after plugin auto-enable to prevent… · openclaw/openclaw@8c11210 fix: repair sanitized replay tool results before send (#67620) (thank… · openclaw/openclaw@c3c7a99 fix: restrict HTML timeout short-circuit to transient statuses · openclaw/openclaw@de129a6 fix: keep TUI watchdog bound to active run (#67401) (thanks @xantorres) · openclaw/openclaw@3525273 Gateway/skills: dedupe skills prefix-match + drop dead fallback on log · openclaw/openclaw@d7f489f Extensions/lmstudio: back off inference preload after consecutive fai… · openclaw/openclaw@b555214 TUI/streaming: add watchdog that resets the activity indicator after … · openclaw/openclaw@f44ab20 Agents/tool-loop: enable unknown-tool stream guard by default · openclaw/openclaw@36ed367 Gateway/skills: invalidate session skills snapshot on config write · openclaw/openclaw@b23d59a fix: classify HTML provider error pages correctly (#67642) (thanks @s… · openclaw/openclaw@e588e90 fix(skills): remove unused model-usage import (#67641) · openclaw/openclaw@55f05df docs(changelog): credit codex fix superseded PRs · openclaw/openclaw@e485f24 fix(openai-codex): normalize stale transport metadata in resolution a… · openclaw/openclaw@90801ba CI: pin Docker-related GitHub Actions (#67632) · openclaw/openclaw@f697b01 Android: modernize WebView and discovery API usage (#67627) · openclaw/openclaw@44a6e50 fix(deps): bump hono to 4.12.14 and @hono/node-server to 1.19.14 (GHS… · openclaw/openclaw@fbccc18 fix(deps): bump dompurify to 3.4.0 (#67614) · openclaw/openclaw@2c2dc00 CI: add explicit permissions to all workflow jobs (fixes code-scannin… · openclaw/openclaw@01b7516 fix: register bundled TTS providers and route overrides correctly (#6… · openclaw/openclaw@6ea3cdd fix: align host tilde paths with OS home (#62804) (thanks @stainlu) · openclaw/openclaw@ecfaf64 fix: flush creds queue before reconnect socket open (#67464) (thanks … · openclaw/openclaw@405c63f fix: strip standalone <function> tool call tags from visible text (#6… · openclaw/openclaw@78df859 fix(agents): preserve cli session metadata before transcript persist … · openclaw/openclaw@898fd04 docs(changelog): move cli transcript entry · openclaw/openclaw@c1817c6 fix(agents): normalize cli transcript api field · openclaw/openclaw@3a3fae0 docs(changelog): note cli transcript persistence · openclaw/openclaw@6c343f1 fix(agents): persist cli transcript turns · openclaw/openclaw@b8ef507 fix(msteams): harden security-sensitive flows (#65841) · openclaw/openclaw@c56b56e [Dashboard] Fix exec approval modal overflow for long command content… · openclaw/openclaw@053c5b0 Docs: remove QA changelog entry · openclaw/openclaw@7fd5771 QA: fix private runtime source loading (#67428) · openclaw/openclaw@d5933af docs(gateway): correct protocol.md schema path, hello-ok example, aut… · openclaw/openclaw@489404d CI: pin Node 22 runners to 22.18.0 · openclaw/openclaw@4ffa621 models.authStatus: normalize provider ids + tighten env-backed escape… · openclaw/openclaw@f2fdb9d Update CHANGELOG.md · openclaw/openclaw@7694a92 test(parallels): clean up npm update guard jobs · openclaw/openclaw@045ea7b Plugins: prefer scanDir override paths · openclaw/openclaw@b2974da fix(dreaming): default storage.mode to "separate" so phase blocks sto… · openclaw/openclaw@8c392f0 fix(memory-core): skip dreaming transcript ingestion via session stor… · openclaw/openclaw@a1b01f0 fix: dedupe replayed exec.finished node events (#67281) · openclaw/openclaw@5dcf526
docs(skills): expand test performance workflow · openclaw/openclaw@4d82dc4
vincentkoc · 2026-04-29 · via Recent Commits to openclaw:main

@@ -1,12 +1,13 @@

11

---

22

name: openclaw-test-performance

3-

description: Benchmark, diagnose, and optimize OpenClaw test runtime, import hotspots, CPU/RSS, and slow coverage paths.

3+

description: Benchmark, diagnose, and optimize OpenClaw test and plugin-suite runtime, import hotspots, CPU/RSS, heap growth, and slow coverage paths.

44

---

5566

# OpenClaw Test Performance

778-

Use evidence first. The goal is real `pnpm test` speed/RSS improvement with

9-

coverage intact, not runner tuning by guesswork.

8+

Use evidence first. The goal is real `pnpm test`, plugin-suite, and

9+

plugin-inspector speed/RSS improvement with coverage intact, not runner tuning by

10+

guesswork.

10111112

## Workflow

1213

@@ -21,6 +22,9 @@ coverage intact, not runner tuning by guesswork.

2122

2. Establish a baseline before changing code:

2223

- Prefer `pnpm test:perf:groups --full-suite --allow-failures --output <file>`

2324

for full-suite ranking.

25+

- For bundled plugin breadth, run the smallest relevant `pnpm

26+

test:extensions:batch <plugin[,plugin...]>` or plugin-inspector command

27+

before jumping to the full extension sweep.

2428

- For a scoped hotspot use:

2529

`/usr/bin/time -l pnpm test <file-or-files> --maxWorkers=1 --reporter=verbose`

2630

- For import-heavy suspicion add:

@@ -33,6 +37,8 @@ coverage intact, not runner tuning by guesswork.

3337

passed, capture that as harness/noise and verify the suspect file directly.

3438

4. Pick the next attack by return and risk:

3539

- High return: one file/test dominates seconds or RSS and has a clear root.

40+

- High leverage: one plugin or SDK barrel causes every plugin-inspector or

41+

extension-batch run to load broad runtime.

3642

- Lower risk: static descriptors, target parsing, routing, auth bypass,

3743

setup hints, registry fixtures, or test server lifecycle.

3844

- Higher risk: real memory/runtime behavior, live providers, protocol

@@ -44,6 +50,8 @@ coverage intact, not runner tuning by guesswork.

4450

and pure helpers over broad mocks.

4551

- Reuse suite-level servers/clients when a fresh handshake is irrelevant.

4652

- Keep schedulers/background loops off unless the test proves scheduling.

53+

- In plugin paths, move static metadata into manifest/lightweight artifacts

54+

and keep runtime plugin loads behind explicit execution boundaries.

4755

6. Preserve coverage shape:

4856

- Do not delete a slow integration proof unless the exact production

4957

composition is extracted into a named helper and tested.

@@ -57,13 +65,103 @@ coverage intact, not runner tuning by guesswork.

5765

9. Commit with `scripts/committer "<message>" <paths...>` and push when the

5866

user asked for commits/pushes. Stage only files touched for this attack.

596768+

## Plugin-Suite Workflow

69+70+

Use this section when perf work involves bundled plugins, plugin-inspector, SDK

71+

barrels, package-boundary tests, or extension suites.

72+73+

1. Map the suite shape first:

74+

- source tests: `pnpm test extensions/<id>` or `pnpm test:extensions:batch <id>`

75+

- package boundaries: `pnpm run test:extensions:package-boundary:canary` and

76+

`pnpm run test:extensions:package-boundary:compile`

77+

- all bundled source tests: `pnpm test:extensions`

78+

- plugin import memory: `pnpm test:extensions:memory -- --json .artifacts/test-perf/extensions-memory.json`

79+

- plugin-inspector/report work: keep report primitives in `plugin-inspector`;

80+

keep wrappers thin and collect peak RSS when the command supports it.

81+

2. Start narrow, then widen:

82+

- one plugin changed: run that plugin's tests and plugin-inspector slice.

83+

- SDK/public barrel changed: add representative provider, channel, memory,

84+

and feature plugins.

85+

- loader/runtime mirror changed: add package-boundary checks and build/package

86+

proof as needed.

87+

- unknown shared plugin behavior: run `test:extensions:batch` groups before

88+

`pnpm test:extensions`.

89+

3. Treat plugin-inspector failures as product signals:

90+

- JSON must parse.

91+

- warnings/errors must be classified, not hidden.

92+

- runtime capture should be quiet and config-tolerant.

93+

- command output should include wall time, exit code, and peak RSS when

94+

available.

95+

4. For broad or package-heavy plugin proof, use Blacksmith Testbox by default on

96+

maintainer machines. Warm once and reuse the same box:

97+

- `blacksmith testbox warmup ci-check-testbox.yml --ref main --idle-timeout 90`

98+

- `blacksmith testbox run --id <ID> "OPENCLAW_TESTBOX=1 pnpm test:extensions:batch <ids>"`

99+

- stop the box when done.

100+

5. If plugin performance is package-artifact sensitive, switch to

101+

`openclaw-pre-release-plugin-testing` and Package Acceptance rather than

102+

trusting source-only timing.

103+104+

## Metric Collection

105+106+

Collect at least one stable metric before and after. Prefer the same machine and

107+

same command. For Testbox comparisons, use the same `tbx_...` id when possible.

108+109+

| Metric | Use for | Preferred source |

110+

| --------------- | ---------------------------------- | --------------------------------------------------------------------------- |

111+

| wall time | user-visible suite cost | `/usr/bin/time -l`, test wrapper duration, Testbox run time |

112+

| Vitest duration | test body/import cost | Vitest output per file/shard |

113+

| import duration | broad barrel/runtime loads | `OPENCLAW_VITEST_IMPORT_DURATIONS=1` |

114+

| max RSS | memory pressure and OOM risk | `/usr/bin/time -l`, `pnpm test:extensions:memory`, wrapper memory summaries |

115+

| CPU/user/sys | CPU-bound vs wait-bound split | `/usr/bin/time -l` locally, Testbox job timing when local CPU is noisy |

116+

| heap snapshots | real leak vs retained module graph | `openclaw-test-heap-leaks` workflow |

117+118+

Local scoped command with CPU/RSS:

119+120+

```bash

121+

timeout 240 /usr/bin/time -l pnpm test <file> --maxWorkers=1 --reporter=verbose

122+

```

123+124+

Plugin import memory profile:

125+126+

```bash

127+

pnpm build

128+

pnpm test:extensions:memory -- --top 20 --json .artifacts/test-perf/extensions-memory.json

129+

```

130+131+

Targeted plugin import memory:

132+133+

```bash

134+

pnpm test:extensions:memory -- --extension discord --extension telegram --skip-combined

135+

```

136+137+

Heap/RSS escalation:

138+139+

```bash

140+

OPENCLAW_TEST_MEMORY_TRACE=1 \

141+

OPENCLAW_TEST_HEAPSNAPSHOT_INTERVAL_MS=60000 \

142+

OPENCLAW_TEST_HEAPSNAPSHOT_DIR=.tmp/heapsnap \

143+

OPENCLAW_TEST_WORKERS=2 \

144+

OPENCLAW_TEST_MAX_OLD_SPACE_SIZE_MB=6144 \

145+

pnpm test

146+

```

147+148+

Use `openclaw-test-heap-leaks` when RSS keeps growing across intervals, workers

149+

OOM, or the suspect command has app-object retention. Do not call RSS growth a

150+

leak until snapshots or retainers support it.

151+60152

## Common Root Causes

6115362154

- Full bundled channel/plugin runtime loaded for static data.

63155

- `getChannelPlugin()` fallback used when an already-loaded fixture or pure

64156

parser would suffice.

65157

- Broad `api.ts`, `runtime-api.ts`, `test-api.ts`, or plugin-sdk barrels pulled

66158

into hot tests.

159+

- SDK root aliases or package barrels pulling focused subpaths back into a broad

160+

plugin graph.

161+

- Plugin-inspector loading runtime code just to render metadata, reports, or CI

162+

policy scores.

163+

- Bundled plugin capture reusing real config/home state instead of synthetic,

164+

redacted, isolated state.

67165

- Partial-real mocks using `importActual()` around broad modules.

68166

- `vi.resetModules()` plus fresh imports in per-test loops.

69167

- Test plugin registry seeded in `beforeAll` while runtime state resets in

@@ -72,6 +170,10 @@ coverage intact, not runner tuning by guesswork.

72170

- Runtime/default model/auth selection paid by idle snapshots or fixtures.

73171

- Plugin-owned media/action discovery triggered before checking whether args

74172

contain plugin-owned fields.

173+

- Timings missing from `test/fixtures/test-timings.unit.json`, causing hotspot

174+

files to stay in shared workers.

175+

- Parallel Vitest runs sharing `node_modules/.experimental-vitest-cache` without

176+

distinct `OPENCLAW_VITEST_FS_MODULE_CACHE_PATH` values.

7517776178

## Benchmark Commands

77179

@@ -97,6 +199,25 @@ pnpm test:perf:groups --full-suite --allow-failures \

97199

--output .artifacts/test-perf/<name>.json

98200

```

99201202+

Extension batch:

203+204+

```bash

205+

pnpm test:extensions:batch <plugin[,plugin...]> -- --reporter=verbose

206+

```

207+208+

All extension tests:

209+210+

```bash

211+

pnpm test:extensions

212+

```

213+214+

Package-boundary plugin checks:

215+216+

```bash

217+

pnpm run test:extensions:package-boundary:canary

218+

pnpm run test:extensions:package-boundary:compile

219+

```

220+100221

Reuse an existing Vitest JSON report:

101222102223

```bash

@@ -107,28 +228,39 @@ pnpm test:perf:groups --report <vitest-json> \

107228

## Verification

108229109230

- Always run the targeted test surface that proves the change.

110-

- Run `pnpm check` before commit unless the change is docs-only and the hook

111-

handles it.

231+

- For source changes, run `pnpm check:changed` before push; in maintainer

232+

Testbox mode run it in the warmed Testbox.

233+

- For test-only changes, run `pnpm test:changed` or the exact edited tests.

112234

- Run `pnpm build` when touching lazy-loading, bundled artifacts, package

113235

boundaries, dynamic imports, build output, or public surfaces.

236+

- For plugin SDK/barrel/runtime changes, add `pnpm plugin-sdk:api:check` or

237+

`pnpm plugin-sdk:api:gen` when the API surface may drift.

238+

- For plugin-suite perf fixes, verify at least one representative plugin batch

239+

plus the changed gate; use Package Acceptance if the bug only exists in a

240+

packed artifact.

114241

- If deps are missing/stale, run `pnpm install` and retry the exact failed

115242

command once.

116243

- Use the report format:

117244118245

```markdown

119-

| Metric | Before | After | Gain |

120-

| -------------- | -----: | ----: | ------------: |

121-

| File wall time | `Xs` | `Ys` | `-Zs` (`P%`) |

122-

| Max RSS | `XMB` | `YMB` | `-ZMB` (`P%`) |

246+

| Metric | Before | After | Gain |

247+

| -------------- | -----: | -----: | ------------: |

248+

| File wall time | `Xs` | `Ys` | `-Zs` (`P%`) |

249+

| Max RSS | `XMB` | `YMB` | `-ZMB` (`P%`) |

250+

| CPU user/sys | `X/Ys` | `A/Bs` | explain |

123251

```

124252125253

## Handoff

126254127255

Keep the final concise:

128256129257

- Root cause.

258+

- Suite/plugin scope.

130259

- Files changed.

131-

- Before/after numbers.

260+

- Before/after wall, Vitest/import, CPU, and RSS numbers where available.

261+

- Leak classification if memory was involved: real leak, retained module graph,

262+

or inconclusive.

132263

- Coverage retained.

133264

- Verification commands.

265+

- Testbox ID or workflow URL for remote proof.

134266

- Commit hash and push status.