Agent skill

Openclaw Test Heap Leaks

by openclaw in openclaw/openclaw

Investigate OpenClaw pnpm test memory growth, Vitest OOMs, RSS spikes, and heap snapshot deltas.

MITAuto-check passedTesting & QA

Install Openclaw Test Heap Leaks

skills CLI
$ npx skills add openclaw/openclaw --skill openclaw-test-heap-leaks -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install openclaw/openclaw openclaw-test-heap-leaks --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/openclaw/openclaw.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/openclaw-test-heap-leaks .claude/skills/openclaw-test-heap-leaks && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
openclaw-test-heap-leaks
GitHub stars
392k
Token cost
~1.9k tokens
SKILL.md length
907 words
Files
3 (incl. scripts)
Skills in repo
97
Repo updated
First seen
Licence
MIT

At a glance

Investigate OpenClaw pnpm test memory growth, Vitest OOMs, RSS spikes, and heap snapshot deltas.

  • Works in 5 steps: Reproduce the failing shape first. → Collect the strongest available heap… → Classify the growth before choosing a fix. → …
  • Tasks that involve Unit testing
  • SKILL.md covers Workflow, Heuristics, Snapshot Comparison and Validating runtime fixes (not…, plus 1 more section
  • Runs JavaScript scripts from its folder; calls node and pnpm

What it does

Openclaw Test Heap Leaks is an agent skill from openclaw/openclaw. Investigate OpenClaw pnpm test memory growth, Vitest OOMs, RSS spikes, and heap snapshot deltas.

Its SKILL.md is about 1.9k tokens, which your agent loads only when the skill is triggered. The skill folder holds 4 other files, including scripts (for example `agents/openai.yaml`).

It sits in Testing & QA, covering Unit testing. It works with pnpm and Vitest. The repository describes itself as: The AI that really does things. Any OS. Any Platform. The lobster way. 🦞. The licence is MIT.

When your agent uses it

  • Tasks that involve Unit testing

Example prompts

  • “/openclaw-test-heap-leaks”

Requirements

  • Node.js

Workflow steps

5 steps, taken from the first numbered list in SKILL.md.

  1. Reproduce the failing shape first.
  2. Collect the strongest available heap evidence.
  3. Classify the growth before choosing a fix.
  4. Fix the right layer.
  5. Verify with the most direct proof.

What it can do on your machine

Read from SKILL.md and the folder at commit 3193e15. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 1 file in scripts/ (JavaScript), which the agent can run.

    Shell commands in SKILL.md call:

    • node
    • pnpm

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use pnpm, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Openclaw Test Heap Leaks loads about 1.9k tokens when it runs. Until then it costs about 30 tokens; SKILL.md has 907 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~30
When it runs · the whole SKILL.md, loaded when a task matches
~1.9k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from openclaw/openclaw at commit 3193e15, republished under its MIT licence (© openclaw). 907 words, ~1,870 tokens.

Download SKILL.mdSave it as .claude/skills/openclaw-test-heap-leaks/SKILL.md (or your agent's skills folder). This skill also uses 2 other files; get the full folder from GitHub.
name
openclaw-test-heap-leaks
description
Investigate OpenClaw pnpm test memory growth, Vitest OOMs, RSS spikes, and heap snapshot deltas.

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.

Read ../openclaw-test-performance/SKILL.md first for the current test-performance commands and proof routing.

For runtime fixes (e.g., closure leaks in long-running services like the gateway), see Validating runtime fixes below — that uses a dedicated harness rather than the unit-test profiling workflow.

Workflow

  1. Reproduce the failing shape first.

    • Match the real entrypoint and worker budget. For a broad unit-fast baseline with per-config max RSS and top-file timing, start with:

      bash
      pnpm test:perf:groups \
        --config test/vitest/vitest.unit-fast.config.ts \
        --allow-failures \
        --output .artifacts/test-perf/unit-fast-memory.json
    • For a suspected file, rerun that file with one worker and collect wall/RSS evidence: /usr/bin/time -l pnpm test <file> --maxWorkers=1 --reporter=verbose.

    • Current pnpm test execution is planned by scripts/test-projects.mts. Record the printed Vitest config or shard and preserve that shape when the report is configuration- or worker-budget-specific.

  2. Collect the strongest available heap evidence.

    • Run pnpm test:perf:profile:runner -- --output-dir .artifacts/test-perf/vitest-runner-profile -- <file> for a CPU profile plus a sampling heap profile of the unit runner. Open the heap profile in DevTools and inspect the largest allocation families.
    • Sampling .heapprofile output is not a .heapsnapshot; do not pass it to the snapshot delta helper.
    • When a dedicated harness or another known producer emits repeated .heapsnapshot files, compare snapshots from the same PID with .agents/skills/openclaw-test-heap-leaks/scripts/heapsnapshot-delta.mjs.
    • If no snapshot or heap profile is available, RSS growth is useful triage evidence, but keep the leak classification inconclusive.
  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:
    • Inspect the owning Vitest config and the process chunking in scripts/test-projects.test-support.mjs. Fix process lifetime or project ownership there only when the same-shape evidence shows that shared-worker retention is the cause.
    • test/vitest/vitest.unit-fast-isolated.config.ts is for audited stateful tests that need a fresh module graph. Do not use it as a generic memory-hotspot list.
    • 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 same grouped or scoped command and confirm the max-RSS trend or OOM is reduced.
    • When a dedicated producer emits heap profiles or snapshots, repeat the same producer and compare equivalent artifacts.
    • For routing or config changes, verify the expected Vitest config or shard starts and the affected tests complete.

Heuristics

  • Do not call everything a leak. Growth in a non-isolated shared Vitest project can be a worker-lifetime problem rather than an application object leak.
  • scripts/test-projects.mts, scripts/test-group-report.mts, and scripts/run-vitest-profile.mts are the current execution, grouped-RSS, and profile entrypoints.
  • The [test] starting ... lines identify the Vitest config or shard to reproduce.
  • .artifacts/vitest-shard-timings.json stores config/shard durations for scheduling. It is not a file-level memory-hotspot or behavior manifest.
  • 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.
Show full SKILL.md (327 more words)Show less

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 <snapshot-directory>
  • Useful flags:
    • --top 40
    • --min-kb 32
    • --pid 16133

Read the top positive deltas first. Large positive growth in module-transform artifacts points to shared-process lifetime or project ownership; 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.

Validating runtime fixes (not test-memory)

The workflow above is for diagnosing Vitest worker memory growth. For validating that a runtime/closure fix actually releases captured state, use the dedicated harness:

  • pnpm leak:embedded-run — runs scripts/embedded-run-abort-leak.ts. Loops N aborted runs in a function-shaped scope mimicking runEmbeddedAttempt, writes heap snapshots, and reports a PASS/FAIL verdict on retention growth using FinalizationRegistry for tracked-instance counting plus RSS delta.

Modes:

  • closure-extracted (default) — production fix shape (helper at module scope).
  • closure-inline — pre-fix shape (closure inside the runner scope). Use as a sensitivity check: if it passes you've broken the harness, not fixed a bug.
  • synthetic-leak — deliberately retains via a module-level bucket. Use to confirm the harness can detect leaks before trusting a PASS on a real fix.

Snapshots land in .tmp/embedded-run-abort-leak/. Diff with the same script as above:

node .agents/skills/openclaw-test-heap-leaks/scripts/heapsnapshot-delta.mjs \
  .tmp/embedded-run-abort-leak/baseline-*.heapsnapshot \
  .tmp/embedded-run-abort-leak/batch-N-*.heapsnapshot --top 30

When fixing a different runtime leak, add a new harness alongside this one rather than retrofitting it. The fixture function should mimic the lexical scope of the function where the leak lives, not be a generic abort-loop.

Output Expectations

When using this skill, report:

  • The exact reproduce command.
  • Which Vitest config or target was reproduced, and which PID was compared when snapshots were available.
  • The dominant retained object families from the heap profile or snapshot delta, when available.
  • 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.

© openclaw, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 2 other files (scripts) in .agents/skills/openclaw-test-heap-leaks of openclaw/openclaw.

  • SKILL.md
  • agents/openai.yaml
  • scripts/heapsnapshot-delta.mjs

Open the folder on GitHubat commit 3193e15

Compare with similar skills

Openclaw Test Heap Leaks next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Openclaw Test Heap Leaks compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Openclaw Test Heap Leaks this skillopenclaw/openclaw392k—~1.9kAutomated safety check: PassMIT
Ckeditor5 TestingTriliumNext/Trilium38k—~3.3kAutomated safety check: PassAGPL-3.0
Ha Frontend Testinghome-assistant/frontend5.7k—~1.7kAutomated safety check: PassApache-2.0
Odc TestingDouglasNeuroInformatics/OpenDataCapture119—~1.5kAutomated safety check: NotesApache-2.0
Next QA Loopbreaking-brake/cc-wf-studio5.4k—~2.5kAutomated safety check: PassCustom licence
Openclaw Test Heap LeaksSafeAI-Lab-X/ClawKeeper1k—~1.2kAutomated safety check: PassNone

Similar skills

  • Ckeditor5 Testing

    TriliumNext/Trilium

    Testing CKEditor 5 plugins in the Trilium monorepo. An agent skill from TriliumNext/Trilium.

    38k GitHub stars~3.3k tokensUpdated today
    Testing & QAAuto-check passed
  • Ha Frontend Testing

    home-assistant/frontend

    Home Assistant frontend testing and validation workflow. An agent skill from home-assistant/frontend.

    5.7k GitHub stars~1.7k tokensUpdated today
    Testing & QAAuto-check passed
  • Odc Testing

    DouglasNeuroInformatics/OpenDataCapture

    Test a change in Open Data Capture. An agent skill from DouglasNeuroInformatics/OpenDataCapture.

    119 GitHub stars~1.5k tokensUpdated 2 days ago
    Testing & QAAuto-check: notes
  • Next QA Loop

    breaking-brake/cc-wf-studio

    Runs one unattended iteration of a QA loop: tend any open QA pull request, then build one queued qa issue as tests or test tooling only and open a PR.

    5.4k GitHub stars~2.5k tokensUpdated 3 days ago
    Testing & QAAuto-check passed
  • Openclaw Test Heap Leaks

    SafeAI-Lab-X/ClawKeeper

    Investigate pnpm test memory growth, Vitest worker OOMs, and suspicious RSS increases in OpenClaw using the scripts/test-parallel.mjs heap snapshot tooling.

    1k GitHub stars~1.2k tokensUpdated 1 mo ago
    Testing & QAAuto-check passed
  • Ever Works

    ever-works/ever-works

    Repo-specific guide to the Ever Works monorepo (ever-works/ever-works) — its pnpm + Turborepo layout, the per-workspace test runners (Jest vs Vitest vs Playwright), file-naming and import-alias…

    162 GitHub stars~2.2k tokensUpdated today
    Testing & QAAuto-check passed

More from openclaw/openclaw

All 97 skills in this repo
  • Model Usage

    openclaw/openclaw

    Summarize CodexBar local cost logs by model for Codex or Claude, including current or full breakdowns.

    392k GitHub starsUsed in 1 repo~637 tokens
    Auto-check passed
  • Openclaw Live Updater

    openclaw/openclaw

    Maintain the canonical live OpenClaw main checkout, macOS LaunchAgent-managed Gateway, local macOS app, exact-head main CI, and recurring full release validation.

    392k GitHub stars~3.7k tokensUpdated today
    Auto-check passed
  • Feishu Doc

    openclaw/openclaw

    Feishu document read/write workflows. An agent skill from openclaw/openclaw.

    392k GitHub stars~516 tokensUpdated today
    Auto-check passed
  • Tmux

    openclaw/openclaw

    Control tmux sessions/panes for interactive CLIs: list, capture output, send keys, paste text, monitor prompts.

    392k GitHub starsUsed in 1 repo~640 tokens
    Auto-check passed
  • Openclaw PR Maintainer

    openclaw/openclaw

    Review, triage, repair, or land OpenClaw issues and pull requests with current-source evidence and the native maintainer workflow.

    392k GitHub stars~2.3k tokensUpdated today
    Auto-check passed
  • Browser Automation

    openclaw/openclaw

    A skill your agent uses when controlling web pages with the OpenClaw browser tool, especially multi-step flows, login checks, tab management, or recovery from stale refs/timeouts.

    392k GitHub stars~2.9k tokensUpdated today
    Auto-check passed

Works with

Categories

Questions about Openclaw Test Heap Leaks

What does Openclaw Test Heap Leaks do?

Investigate OpenClaw pnpm test memory growth, Vitest OOMs, RSS spikes, and heap snapshot deltas. Openclaw Test Heap Leaks is an agent skill from openclaw/openclaw. Investigate OpenClaw pnpm test memory growth, Vitest OOMs, RSS spikes, and heap snapshot deltas.

When should I use Openclaw Test Heap Leaks?

Openclaw Test Heap Leaks fits situations like: tasks that involve Unit testing.

How do I install Openclaw Test Heap Leaks in Claude Code?

Run `npx skills add openclaw/openclaw --skill openclaw-test-heap-leaks -a claude-code`. Or copy the skill folder (.agents/skills/openclaw-test-heap-leaks in openclaw/openclaw) into .claude/skills/openclaw-test-heap-leaks in your project. Claude Code loads it when a task matches its description.

How do I install Openclaw Test Heap Leaks in Codex?

Run `npx skills add openclaw/openclaw --skill openclaw-test-heap-leaks -a codex`. Or copy the skill folder (.agents/skills/openclaw-test-heap-leaks in openclaw/openclaw) into .agents/skills/openclaw-test-heap-leaks in your project. Codex loads it when a task matches its description.

Can I use Openclaw Test Heap Leaks in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add openclaw/openclaw --skill openclaw-test-heap-leaks -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/openclaw-test-heap-leaks, .gemini/skills/openclaw-test-heap-leaks, .github/skills/openclaw-test-heap-leaks and .opencode/skills/openclaw-test-heap-leaks in your project.

What does Openclaw Test Heap Leaks need to run?

Going by SKILL.md and its folder, Openclaw Test Heap Leaks needs JavaScript for the scripts in its folder and the command-line tools its instructions call (node and pnpm). Our summary lists: Node.js.

Does Openclaw Test Heap Leaks access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Openclaw Test Heap Leaks safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Openclaw Test Heap Leaks use?

Openclaw Test Heap Leaks is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Openclaw Test Heap Leaks use?

About 1.9k tokens (SKILL.md is roughly 7.5k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Openclaw Test Heap Leaks?

Skills that share tags, products or a category with Openclaw Test Heap Leaks: Ckeditor5 Testing (TriliumNext/Trilium, 38k stars), Ha Frontend Testing (home-assistant/frontend, 5.7k stars), Odc Testing (DouglasNeuroInformatics/OpenDataCapture, 119 stars) and Next QA Loop (breaking-brake/cc-wf-studio, 5.4k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Openclaw Test Heap Leaks?

openclaw (a GitHub organization) maintains it in openclaw/openclaw, which has 391,562 GitHub stars. The repository holds 97 skills in this directory. The repository was last updated on October 10, 2026.

Source: openclaw/openclaw on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.