帮助定位 OpenClaw 测试中的内存增长、堆泄漏与 OOM 根因
该技能材料显示其为用于测试内存排查的提示/文档型技能,无需密钥、未声明远程端点,且来源为高星开源 GitHub 仓库,整体风险较低。README 中出现本地命令与脚本路径,但在当前材料下更像操作指引而非内置执行能力,主要需留意其可能引导用户接触本地测试数据与脚本。
材料明确标注无需密钥或环境变量,未见请求 API token、账号口令或其他敏感凭证,也未见明显的凭证收集或滥用路径。
未声明任何远程端点,内容聚焦本地测试内存快照分析;材料中未见将用户数据发送到外部服务的说明。
README 给出 `pnpm test`、构建命令和本地脚本路径,说明其使用场景会引导在本机运行测试/脚本;这属于常规开发工具能力,当前材料未显示额外越权执行或隐蔽系统操作。
技能面向堆快照与测试产物排查,涉及读取本地项目测试输出并在如 `.tmp/heapsnap` 目录写入快照;这属于该类诊断工具的正常数据接触范围,未见申请超出用途的广泛访问。
来源为 GitHub 开源仓库,且社区采用度极高(约 377k stars),可审计性与可信度均较强;许可证与维护状态未明确,属轻微信息缺口,但不足以单独抬升风险。
复制安装指令,让 AI 自动完成配置 · 推荐新手
请帮我安装 askskill 上的 "openclaw-test-heap-leaks" 技能: 1. 下载 https://raw.githubusercontent.com/openclaw/openclaw/main/.agents/skills/openclaw-test-heap-leaks/SKILL.md 2. 保存为 ~/.claude/skills/openclaw-test-heap-leaks/SKILL.md 3. 装好后重载技能,告诉我可以用了
请帮我分析 OpenClaw 在 pnpm test 期间的内存增长问题。结合 RSS 曲线、heap snapshot 对比和可能的测试隔离问题,给出最可能的泄漏来源、验证步骤以及修复建议。
一份定位报告,包含可疑泄漏点、证据链、复现与验证方法,以及具体修复方向。
我有两份测试前后的 Node.js heap snapshot,请帮我比较 retained size 增长明显的对象类型,判断哪些可能是未释放的模块缓存、事件监听器或全局状态。
一份堆快照差异解读,指出增长异常的对象类别及其潜在代码来源。
基于 OpenClaw 当前测试执行方式,帮我提出降低 RSS 峰值和避免 Vitest OOM 的优化方案,覆盖并发数、测试拆分、资源清理和调试开关设置。
一套可执行的测试优化清单,按优先级列出预期收益、实施方式和风险。
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.
For runtime fixes (e.g., closure leaks in long-running services like the gateway), see Validating runtime fixes below — that uses a dedicated harness, not the test-parallel snapshot machinery.
Reproduce the failing shape first.
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 testOPENCLAW_TEST_MEMORY_TRACE=1 enabled so the wrapper prints per-file RSS summaries alongside the snapshots.[test-parallel] start ... lines or pnpm test --plan. Do not assume a single unit-fast lane; local plans often split into unit-fast-batch-*.Wait for repeated snapshots before concluding anything.
.tmp/heapsnap/unit-fast-batch-2/..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.Classify the growth before choosing a fix.
Module, system / Context, bytecode, descriptor arrays, or property maps, treat it as likely retained module graph growth in long-lived workers.Fix the right layer.
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.test/fixtures/test-parallel.behavior.json only when timing-driven peeling is insufficient.singletonIsolated for files that are safe alone but inflate shared worker heaps.test/fixtures/test-timings.unit.json, call that out explicitly. Missing timings are a scheduling blind spot.afterEach/afterAll, module-reset gaps, retained global state, unreleased DB handles, or listeners/timers that survive the file.Verify with the most direct proof.
…
按模型汇总 CodexBar 本地费用日志,快速查看 Codex 或 Claude 的成本明细。
用于分析并优化 OpenClaw 测试与插件套件的性能瓶颈、内存占用和覆盖率耗时。
帮助你创建、整理、校验并重构 AgentSkills 与 SKILL.md 技能文件。
快速搭建一次性原型,验证方案可行性并给出对比结论。
通过 macOS 命令行创建、整理、搜索并导出 Apple Notes 笔记。
帮助维护者分诊、清理并解决 GitHub 中的 OpenClaw 密钥泄露告警。
帮助你在核对来源的前提下重构 OpenClaw 文档页面并完成验证
基于 Git 历史重生成 OpenClaw 发布更新日志,便于发版前整理版本说明。
帮助开发者选择并执行 OpenClaw 测试、CI 校验与发布验证的最优路径。
帮助维护者快速审查、分诊并处理 OpenClaw 的 Issue 与 PR。
帮助开发与运维团队运行、排查并总结 OpenClaw 发布 CI 与发布前检查流程
帮助你运行、观察、调试并扩展 OpenClaw 的 QA 场景与测试产物