openclaw - 💡(How to fix) Fix Guard P2P plugin startup during CLI metadata build [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

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#62074Fetched 2026-04-08 03:09:21
View on GitHub
Comments
0
Participants
1
Timeline
0
Reactions
0
Author
Participants

Fix Action

Fix / Workaround

Why

P2P is a long-running service by design; it should not start during a build-time help/metadata render. This keeps the build deterministic and avoids the forced process.exit workaround.

RAW_BUFFERClick to expand / collapse

Problem

The build step scripts/write-cli-startup-metadata.ts imports the root-help bundle, which loads plugin CLI descriptors. This triggers the integrated P2P plugin to start and keep open handles, causing the build to hang unless we force-exit.

Proposal

Add an environment guard in the P2P plugin to skip auto-start when OPENCLAW_DISABLE_P2P=1. Then set that env var in the metadata build path (or equivalent build invocation) so the plugin never starts during write-cli-startup-metadata.

Why

P2P is a long-running service by design; it should not start during a build-time help/metadata render. This keeps the build deterministic and avoids the forced process.exit workaround.

Notes

  • Verified outputRootHelp() completes, but the P2P service leaves open handles.
  • Minimal safe fix is a guard in the P2P plugin + env set only for the metadata build.

extent analysis

TL;DR

Set the OPENCLAW_DISABLE_P2P=1 environment variable in the metadata build path to prevent the P2P plugin from starting and causing the build to hang.

Guidance

  • Add an environment guard in the P2P plugin to skip auto-start when OPENCLAW_DISABLE_P2P=1 is set.
  • Set the OPENCLAW_DISABLE_P2P=1 environment variable in the metadata build path or equivalent build invocation.
  • Verify that the outputRootHelp() function completes without leaving open handles after implementing the fix.
  • Consider adding a check to ensure the environment variable is only set for the metadata build to avoid affecting other parts of the system.

Example

// In the P2P plugin
if (process.env.OPENCLAW_DISABLE_P2P === '1') {
  // Skip auto-start
  return;
}

Notes

This fix assumes that the OPENCLAW_DISABLE_P2P environment variable is not used elsewhere in the system and that setting it to 1 will not have unintended consequences.

Recommendation

Apply the workaround by setting the OPENCLAW_DISABLE_P2P=1 environment variable in the metadata build path, as it provides a minimal and safe fix to prevent the build from hanging.

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