openclaw-test-heap-leaks
Investigate `pnpm test` memory growth, Vitest worker OOMs, and suspicious RSS increases in OpenClaw using the `scripts/test-parallel.mjs` heap snapshot tooling.
Skill by Arry8
Chalk Labs
Need help deploying openclaw-test-heap-leaks?
Chalk Labs sets up agents like this inside real teams: connected to your tools, tested on your data, with a human in the loop where it matters.
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/arry8-openclaw-test-heap-leaks
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: testing, marketing, agent-building
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions: not checked yet.
What's inside
- Skill name
openclaw-test-heap-leaks- Description
- Investigate `pnpm test` memory growth, Vitest worker OOMs, and suspicious RSS increases in OpenClaw using the `scripts/test-parallel.mjs` heap snapshot tooling. Use when Codex needs to reproduce test-lane memory growth, collect repeated `.heapsnapshot` files, compare snapshots from the same worker PID, triage likely transformed-module retention versus likely runtime leaks, and fix or reduce the impact by patching cleanup logic or isolating hotspot tests.
- License
- MIT
- Instructions
- 78 lines in SKILL.md · view on GitHub
Before installing
- Ships executable scripts
Agent Skills spec issues
- files: referenced but missing: scripts/test-update-memory-hotspots.mjs, scripts/test-parallel.mjs, scripts/test-parallel-memory.mjs
Files (3)
- SKILL.md
- openai.yaml · agents/
- heapsnapshot-delta.mjs · scripts/
SKILL.md (first lines)
```bash # preamble: check for openclaw updates (reads cached state, no network call) _UPD=$(openclaw update hint 2>/dev/null || true) [ -n "$_UPD" ] && echo "$_UPD" || true ``` # OpenClaw Test Heap Leaks Use this skill for test-memory investigations. Do not guess from RSS alone when heap snapshots are available. Treat snapshot-name deltas as triage evidence, not proof, until retainers or dominators support the call. ## Workflow 1. Reproduce the failing shape first. - Match the real entrypoint if possible. For Linux CI-style unit failures, start with: - `pnpm canvas:a2ui:bundle && OPENCLAW_TEST_MEMORY_TRACE=1 OPENCLAW_TEST_HEAPSNAPSHOT_INTERVAL_MS=60000 OPENCLAW_TEST_HEAPSNAPSHOT_DIR=.tmp/heapsnap OPENCLAW_TEST_WORKERS=2 OPENCLAW_TEST_MAX_OLD_SPACE_SIZE_MB=6144 pnpm test` - Keep `OPENCLAW_TEST_MEMORY_TRACE=1` enabled so the wrapper prints per-file RSS summaries alongside the snapshots. - If the report is about a specific shard or worker budget, preserve that shape. - Before you analyze snapshots, identify the real lane names from `[test-parallel] start ...` lines or `pnpm test --plan`. Do not assume a single `unit-fast` lane; local plans often split into `unit-fast-batch-*`. 2. Wait for repeated snapshots before concluding anything. - Take at least two intervals from the same lane. - Compare snapshots from the same PID inside the real lane directory such as `.tmp/heapsnap/unit-fast-batch-2/`. - Use `.agents/skills/openclaw-test-heap-leaks/scripts/heapsnapshot-delta.mjs` to compare either two files directly or the earliest/latest pair per PID in one lane directory. - If the helper suggests transformed-module retention, confirm the top entries in DevTools retainers/dominators before calling it solved. 3. Classify the growth before choosing a fix. - If growth is dominated by Vite/Vitest transformed source strings, `Module`, `system / Context`, bytecode, descriptor arrays, or property maps, treat it as likely retained module graph growth in long-lived workers. - If growth is dominated by app objects, caches, buffers, server handles, timers, mock state, sqlite state, or similar runtime objects, treat it as a likely cleanup or lifecycle leak. - If the names are ambiguous, stop short of a confident label and inspect retainers/dominators in DevTools for the top deltas. 4. Fix the right layer. - For likely retained transformed-module growth in shared workers: - Prefer timing and hotspot-driven scheduling fixes first. Check whether the file is already represented in `test/fixtures/test-timings.unit.json` and whether `scripts/test-update-memory-hotspots.mjs` should refresh the measured hotspot manifest before hand-editing behavior overrides. - Move hotspot files out of the real shared lane by updating `test/fixtures/test-parallel.behavior.json` only when timing-driven peeling is insufficient. - Prefer `singletonIsolated` for files that are safe alone but inflate shared worker heaps. - If the file should already have been peeled out by timings but is absent from `test/fixtures/test-timings.unit.json`, call that out explicitly. Missing timings are a scheduling blind spot. - For real leaks: - Patch the implicated test or runtime cleanup path. - Look for missing `afterEach`/`afterAll`, module-reset gaps, retained global state, unreleased DB handles, or listeners/timers that survive the file. 5. Verify with the most direct proof. - Re-run the targeted lane or file with heap snapshots enabled if the suite still finishes in reasonable time. - If snapshot overhead pushes tests over Vitest timeouts, fall back to the same lane without snapshots and confirm the RSS trend or OOM is reduced. - For wrapper-only changes, at minimum verify the expected lanes start and the snapshot files are written. ## Heuristics - Do not call everything a leak. In this repo, large `unit-fast` or `unit-fast-batch-*` growth can be a worker-lifetime problem rather than an application object leak. - `scripts/test-parallel.mjs` and `scripts/test-parallel-memory.mjs` are the primary control points for wrapper diagnostics. - The lane names printed by `[test-parallel] start ...` and `[test-parallel][mem] summary ...` tell you where to focus. - When one or two files account for most of the delta and they are missing from timings, reducing impact by isolating them is usually the first pragmatic fix. - When the same retained object families grow across multiple intervals in the same worker PID, trust the snapshots over intuition, then confirm ambiguous calls with retainer evidence. ## Snapshot Comparison - Direct comparison: - `node .agents/skills/openclaw-test-heap-leaks/scripts/heapsnapshot-delta.mjs before.heapsnapshot after.heapsnapshot` - Auto-select earliest/latest snapshots per PID within one lane: - `node .agents/skills/openclaw-test-heap-leaks/scripts/heapsnapshot-delta.mjs --lane-dir .tmp/heapsnap/unit-fast-batch-2` - Useful flags: - `--top 40` - `--min-kb 32` - `--pid 16133` Read the top positive deltas first. Large positive growth in module-transform artifacts suggests lane isolation; large positive growth in runtime objects suggests a real leak. If the names alone do not settle it, open the same snapshot pair in DevTools and inspect retainers/dominators for the top rows before declaring root cause. ## Output Expectations When using this skill, report: - The exact reproduce command. - Which lane and PID were compared. - The dominant retained object families from the snapshot delta. - Whether the issue is a likely real leak or likely shared-worker retained module growth, plus whether retainers/dominators confirmed it. - The concrete fix or impact-reduction patch. - What you verified, and what snapshot overhead prevented you from verifying.
From Arry8/openclaw-edge, MIT.
More from Arry8/openclaw-edge
- 0.448score
portfolio-intel
Arry8
Portfolio intelligence copilot.
SkillDFreshness: D★ 2Claude Code +9 - 0.445score
task-pua
Arry8
Task persistence enhancer with 13 corporate flavors.
SkillDFreshness: D★ 2Claude Code +9 - 0.445score
claude-memory-optimizer
Arry8
Structured memory system with 4-type classification, frontmatter metadata, automated migration, and PUA-style maintenance checklist.
SkillDFreshness: D★ 2Claude Code +9 - 0.445score
hermes-learning-loop
Arry8
Self-improving learning loop inspired by Hermes Agent.
SkillDFreshness: D★ 2Claude Code +9 - 0.444score
kernel-cp-activator
Arry8
Deploy KERNEL_INTUITION_Cp on any AI architecture with calibrated thresholds.
SkillDFreshness: D★ 2Claude Code +9 - 0.442score
feishu-bot-refresh
Arry8
Refresh Feishu bot identity information.
SkillDFreshness: D★ 2Claude Code +9 - 0.440score
security-triage
Arry8
Triage GitHub security advisories for OpenClaw with high-confidence close/keep decisions, exact tag and commit verification, trust-model checks, optional…
SkillDFreshness: D★ 2Claude Code +9 - 0.440score
vpn-deployment
Arry8
End-to-end WireGuard VPN deployment guide — VPS server setup, router client configuration, and traffic routing via apfree-wifidog tools.
SkillDFreshness: D★ 2Claude Code +9 - 0.436score
apfree-wifidog
Arry8
Guide tool usage for managing ApFree WiFiDog routers, gateways, and captive portal devices.
SkillDFreshness: D★ 2Claude Code +9 - 0.417score
acp-router
Arry8
Route plain-language requests for Pi, Claude Code, Codex, Cursor, Copilot, OpenClaw ACP, OpenCode, Gemini CLI, Qwen, Kiro, Kimi, iFlow, Factory Droid…
SkillDFreshness: D★ 2Claude Code +9
Signals
- Stars
- 2
- Forks
- 0
- Open issues
- 10
- Last commit (this folder)
- Apr 3, 2026 (7 months ago)
- Last release
- Apr 10, 2026 (6 months ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- MIT
- Repository
- github.com/Arry8/openclaw-edge
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
Same skill elsewhere
Copies of this SKILL.md published by others; search shows only one of them.
More from Arry8
- 0.448score
portfolio-intel
Arry8
Portfolio intelligence copilot.
SkillDFreshness: D★ 2Claude Code +9 - 0.445score
task-pua
Arry8
Task persistence enhancer with 13 corporate flavors.
SkillDFreshness: D★ 2Claude Code +9 - 0.445score
claude-memory-optimizer
Arry8
Structured memory system with 4-type classification, frontmatter metadata, automated migration, and PUA-style maintenance checklist.
SkillDFreshness: D★ 2Claude Code +9 - 0.445score
hermes-learning-loop
Arry8
Self-improving learning loop inspired by Hermes Agent.
SkillDFreshness: D★ 2Claude Code +9 - 0.444score
kernel-cp-activator
Arry8
Deploy KERNEL_INTUITION_Cp on any AI architecture with calibrated thresholds.
SkillDFreshness: D★ 2Claude Code +9 - 0.442score
feishu-bot-refresh
Arry8
Refresh Feishu bot identity information.
SkillDFreshness: D★ 2Claude Code +9
Done for you
Rather not set it up yourself?
Chalk Labs scopes, builds and runs agents for your team: the task audit, the eval harness, the integrations and the weekly ops report. Fixed scope, priced before we start.
See how we build AI agents →Read the case studies
Chalk Labs is a two-founder AI and growth studio. We build AI agents, CRMs and MVPs for Web3 and AI companies, and have shipped 50+ product and token launches.
- launches shipped
- 50+
- launches shipped
- media placements
- 500+
- media placements
- founders on every account
- 2
- founders on every account
Press we've placed: Forbes · CoinDesk · Decrypt · Cointelegraph · The Block
Rahil Jain, Co-founder, Chalk Labs. Ex-Goldman Sachs engineer. You talk to the person who builds it.
Get openclaw-test-heap-leaks running in your business
Tell us what you want to automate. A founder replies within one working day with a plan, not a pitch deck.
Cite this page
openclaw-test-heap-leaks skill. Agent Mart. https://agentmart.dev/skills/arry8-openclaw-test-heap-leaks (last updated 2026-10-24)