openclaw - 💡(How to fix) Fix Temp directory for RSS hook never cleaned up in bench-cli-startup main() [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#83920Fetched 2026-05-20 03:46:40
View on GitHub
Comments
1
Participants
2
Timeline
4
Reactions
1
Timeline (top)
closed ×1commented ×1labeled ×1unsubscribed ×1

Fix Action

Fix / Workaround

Severity: low / Confidence: high / Category: bug Triage: confirmed-bug Detected against: openclaw v2026.5.18 (latest stable at time of scan, 2026-05-18) Tooling: clawpatch 0.3.0 + acpx/claude-sonnet-4-5 via Brad Mills protocol


Standardized clawpatch finding. Persistent in v2026.5.18 (not resolved by upgrading from v2026.5.12). Finding ID: fnd_sig-feat-cli-command-23edfe2554-_2d685e0419.

Code Example

const tmpDir = mkdtempSync(path.join(os.tmpdir(), "openclaw-cli-bench-"));
  const rssHookPath = buildRssHook(tmpDir);
  try {
RAW_BUFFERClick to expand / collapse

Severity: low / Confidence: high / Category: bug Triage: confirmed-bug Detected against: openclaw v2026.5.18 (latest stable at time of scan, 2026-05-18) Tooling: clawpatch 0.3.0 + acpx/claude-sonnet-4-5 via Brad Mills protocol

Evidence

  • scripts/bench-cli-startup.ts:484-490 (main)
const tmpDir = mkdtempSync(path.join(os.tmpdir(), "openclaw-cli-bench-"));
  const rssHookPath = buildRssHook(tmpDir);
  try {

Reasoning

main() creates a temp directory (tmpDir) to hold the RSS hook script via mkdtempSync, but there is no finally block or cleanup call for tmpDir. Each invocation of the benchmark leaves an orphaned directory under the OS temp path. runSample() does clean up its per-run temp dirs with a try/finally, but the shared RSS hook directory is separate and is never deleted.

Reproduction

Run pnpm tsx scripts/bench-cli-startup.ts --runs 1 and check ls /tmp/openclaw-cli-bench-* — the directory persists after the process exits.

Recommendation

Wrap the body of main() in a try/finally block that calls rmSync(tmpDir, { recursive: true, force: true }), mirroring the cleanup pattern used in check-cli-startup-memory.mjs.

Why existing tests miss this

No tests exist for this script (tests array is empty). The leak only manifests at the OS level after process exit, so in-process tests wouldn't catch it.

Minimum fix scope

Add a try/finally around the body of main() in scripts/bench-cli-startup.ts that removes tmpDir unconditionally on exit.


Standardized clawpatch finding. Persistent in v2026.5.18 (not resolved by upgrading from v2026.5.12). Finding ID: fnd_sig-feat-cli-command-23edfe2554-_2d685e0419.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

openclaw - 💡(How to fix) Fix Temp directory for RSS hook never cleaned up in bench-cli-startup main() [1 comments, 2 participants]