Skip to content

docs(contributing): add Development Environment section with WSL2 setup guide#59126

Closed
alkor2000 wants to merge 3 commits intoopenclaw:mainfrom
alkor2000:docs/contributing-wsl2-dev-setup
Closed

docs(contributing): add Development Environment section with WSL2 setup guide#59126
alkor2000 wants to merge 3 commits intoopenclaw:mainfrom
alkor2000:docs/contributing-wsl2-dev-setup

Conversation

@alkor2000
Copy link
Copy Markdown

Summary

Add a "Development Environment" section to CONTRIBUTING.md, covering prerequisites, Windows/WSL2 setup, and a quick-start guide for building from source.

Problem

CONTRIBUTING.md currently jumps straight to "Before You PR" without explaining how to set up a development environment. Windows contributors in particular have no guidance on WSL2 — they must discover through trial and error that systemd needs to be enabled, .wslconfig should set resource limits, and the Linux file system should be used for performance.

Changes

New section added between "How to Contribute" and "Before You PR":

  • Prerequisites — Node.js ≥ 22.12.0 and pnpm requirements
  • Windows (WSL2) — four key setup notes based on hands-on experience:
    1. Enable systemd in /etc/wsl.conf
    2. Set .wslconfig resource limits
    3. Keep terminal open (minimize, don't close)
    4. Use Linux file system for performance
  • Getting started from source — clone → pnpm install → build → verify

Context

These notes are based on setting up an OpenClaw development environment from scratch on a Windows 11 ThinkPad 16 (WSL2 + Ubuntu 24.04 + Node.js 24.14.0 + pnpm 10.32.1). Every tip addresses an actual friction point encountered during the process.

AI Disclosure

This PR was developed with AI assistance (Claude). The author has reviewed all content and confirms accuracy from direct experience.

…up guide

Add a new 'Development Environment' section to CONTRIBUTING.md covering:

- Prerequisites: Node.js >= 22.12.0 and pnpm requirements
- Windows (WSL2): step-by-step notes for WSL2 contributors including
  systemd enablement, .wslconfig resource limits, terminal behavior,
  and file system performance guidance
- Getting started from source: clone/install/build quick-start commands

This information was previously undocumented, leaving Windows contributors
to discover WSL2 requirements through trial and error. The WSL2 notes are
based on hands-on experience setting up an OpenClaw development environment
on a Windows 11 ThinkPad with WSL2 Ubuntu 24.04.

AI Disclosure: This PR was developed with AI assistance (Claude). The
author has reviewed all content and confirms accuracy from direct experience.
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Apr 1, 2026

Greptile Summary

This PR adds a new "Development Environment" section to CONTRIBUTING.md covering prerequisites, Windows/WSL2 setup, and a getting-started-from-source guide. The content is well-structured and addresses real friction points for Windows contributors who lack any setup guidance today.

  • One P1 issue: The /etc/wsl.conf instruction presents [boot] systemd=true as a single inline string to copy in, but INI format requires [boot] and systemd=true on separate lines. A user who adds the literal one-liner will silently fail to enable systemd.
  • Two P2 suggestions: sudo npm install -g pnpm is incorrect for nvm-managed Node.js installs (the most common WSL2 setup); and the opening sentence calling the stack "Node.js 24 LTS" is inconsistent with the "≥ 22.12.0" prerequisite bullet and the repo's documented Node 22+ baseline.
  • The pnpm ui:buildpnpm build build sequence is accurate (the main build script does not include the UI build step).
  • All pnpm script names referenced (ui:build, gateway:watch, openclaw) exist in the root package.json.

Confidence Score: 4/5

Safe to merge after fixing the wsl.conf syntax — the current phrasing will silently prevent systemd from being enabled for Windows contributors following the guide.

One P1 finding: the /etc/wsl.conf instruction is formatted ambiguously and a user copying it literally will not get systemd enabled, which defeats the primary purpose of that step. The two P2 findings are quality improvements but do not break anything. Score is 4 rather than 5 because of the P1 docs-accuracy bug.

CONTRIBUTING.md — specifically the wsl.conf systemd instruction on line 103 and the Node.js version wording on line 90.

Prompt To Fix All With AI
This is a comment left during a code review.
Path: CONTRIBUTING.md
Line: 103

Comment:
**`/etc/wsl.conf` INI syntax is ambiguous**

The instruction `add [boot] systemd=true to /etc/wsl.conf` presents a single inline string, but `/etc/wsl.conf` uses standard INI format where `[boot]` must be a standalone section header on its own line, followed by `systemd=true` on the next line. A user who literally adds `[boot] systemd=true` as one line will get no effect — systemd will remain disabled and the error will be silent.

A small code block avoids any ambiguity:

```suggestion
1. **Enable systemd** — add the following to `/etc/wsl.conf` inside your Ubuntu instance and restart WSL (`wsl --shutdown` from PowerShell). The gateway daemon service requires systemd.

```ini
[boot]
systemd=true
```
```

How can I resolve this? If you propose a fix, please make it concise.

---

This is a comment left during a code review.
Path: CONTRIBUTING.md
Line: 95

Comment:
**`sudo npm install -g pnpm` can break nvm-managed installs**

Using `sudo` with npm is the correct approach when Node.js is installed system-wide (e.g. via NodeSource), but it will fail or install to the wrong location when Node.js is managed by `nvm` — which is a very common WSL2 setup. With `nvm`, the prefix is per-user and `sudo` switches to the root user's separate npm environment.

Consider noting the nvm alternative, or dropping `sudo` and letting the reader use whichever approach matches their install:

```suggestion
- **pnpm** — install globally with `npm install -g pnpm` (add `sudo` if Node.js was installed system-wide via NodeSource; omit it if you use nvm). The project workspace configuration requires pnpm; npm alone is not sufficient for source builds.
```

How can I resolve this? If you propose a fix, please make it concise.

---

This is a comment left during a code review.
Path: CONTRIBUTING.md
Line: 90

Comment:
**Node version statement is inconsistent with prerequisites**

The opening sentence says OpenClaw is built on "Node.js 24 LTS", but the Prerequisites bullet immediately below says "Node.js ≥ 22.12.0", and the repository's own `AGENTS.md` defines the runtime baseline as Node 22+. Stating "24 LTS" as the build target while requiring only 22+ is slightly contradictory and may confuse contributors who are on 22.x.

Consider aligning the wording:

```suggestion
OpenClaw is built with **TypeScript** on **Node.js** (22 LTS minimum, 24 LTS recommended) and uses **pnpm** as its package manager for source development.
```

How can I resolve this? If you propose a fix, please make it concise.

Reviews (1): Last reviewed commit: "docs(contributing): add Development Envi..." | Re-trigger Greptile

Comment thread CONTRIBUTING.md Outdated
Comment thread CONTRIBUTING.md Outdated
Comment thread CONTRIBUTING.md Outdated
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 25ae201722

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread CONTRIBUTING.md Outdated
- P1: wsl.conf systemd instruction now uses a code block instead of
  ambiguous inline text to prevent silent INI syntax errors (Greptile)
- P2: Node.js version wording aligned with repo baseline (22 LTS min,
  24 LTS recommended) and minimum bumped to 22.14.0 per package.json
  engines field (Greptile + Codex)
- P2: pnpm install note now covers both system-wide (sudo) and
  nvm-managed (no sudo) Node.js setups (Greptile)
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 79425ecad6

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread CONTRIBUTING.md Outdated
The ini code block for wsl.conf was opened with four backticks but
closed with three, causing GitHub Markdown to render the rest of the
document as a code block. Also removed an orphan trailing fence at
EOF. (Codex P2 review)
@vincentkoc vincentkoc added the triage: low-signal-docs Candidate: docs-only change looks low signal; maintainer review needed. label Apr 26, 2026
@clawsweeper
Copy link
Copy Markdown
Contributor

clawsweeper Bot commented Apr 26, 2026

Codex review: found issues before merge.

What this changes:

This PR adds a CONTRIBUTING.md Development Environment section covering Node/pnpm prerequisites, WSL2 setup tips, and source-build commands.

Maintainer follow-up before merge:

This remains a docs/editorial PR that needs maintainer re-scope rather than an autonomous replacement or fix PR.

Security review:

Security review cleared: Docs-only CONTRIBUTING.md changes do not alter code execution, CI, dependencies, package resolution, secrets handling, or release paths.

Review findings:

  • [P2] Align Windows guidance with native support docs — CONTRIBUTING.md:97
Review details

Best possible solution:

Keep the contribution open, rebase it, and make CONTRIBUTING.md a short pointer to the canonical setup pages while moving any accepted missing WSL2 contributor tips into docs/platforms/windows.md or docs/start/setup.md.

Do we have a high-confidence way to reproduce the issue?

Not applicable as a docs PR. The high-confidence review path is comparing the PR diff against current CONTRIBUTING.md, README.md, docs/platforms/windows.md, docs/start/setup.md, and targeted searches for the WSL2 tuning notes.

Is this the best way to solve the issue?

No. The current PR is useful but no longer the best shape because it duplicates canonical docs and should be re-scoped to links plus narrowly missing WSL2 notes.

Full review comments:

  • [P2] Align Windows guidance with native support docs — CONTRIBUTING.md:97
    Current docs/platforms/windows.md says native Windows works for core CLI and Gateway use while WSL2 is recommended. This added CONTRIBUTING sentence says Windows contributors should use WSL2 and that gateway daemon/systemd/socket paths all assume Linux, which would contradict the canonical Windows page and mislead native Windows contributors. Reword it to link the Windows docs and say WSL2 is recommended for the full experience.
    Confidence: 0.86

Overall correctness: patch is incorrect
Overall confidence: 0.86

Acceptance criteria:

  • pnpm docs:list
  • pnpm exec oxfmt --check --threads=1 CONTRIBUTING.md README.md docs/platforms/windows.md docs/start/setup.md docs/install/node.md

What I checked:

  • PR diff: The PR adds a new Development Environment section to CONTRIBUTING.md with WSL2 setup notes, .wslconfig resource limits, terminal lifetime guidance, filesystem performance guidance, and a source build quick start. (CONTRIBUTING.md:86, 57c6fcad13cf)
  • Current CONTRIBUTING layout: Current main still goes from How to Contribute to PR Limits and Before You PR, with no Development Environment section in CONTRIBUTING.md. (CONTRIBUTING.md:86, 388019f5b693)
  • Overlapping source docs: README.md now has a From source (development) section with clone, pnpm install, pnpm openclaw setup, pnpm ui:build, pnpm gateway:watch, and build guidance. (README.md:211, 388019f5b693)
  • Canonical Windows docs: docs/platforms/windows.md documents native Windows plus WSL2, recommends WSL2 for the full experience, and includes WSL2 install, systemd enablement, and source dev-loop commands. Public docs: docs/platforms/windows.md. (docs/platforms/windows.md:10, 388019f5b693)
  • Missing WSL2 tuning details: A targeted search found no general setup coverage for the PR's .wslconfig resource-limit example, Linux-filesystem performance warning, or keep-terminal-open caveat; the only .wslconfig hit is an Ollama-specific autoMemoryReclaim note. Public docs: docs/providers/ollama.md. (docs/providers/ollama.md:995, 388019f5b693)
  • Review follow-through: The provided PR discussion and PR commit API show the author addressed earlier docs-accuracy feedback in commits 79425ec and 57c6fca, so this remains a plausible contribution rather than an obsolete abandoned patch. (CONTRIBUTING.md:92, 57c6fcad13cf)

Likely related people:

  • @vincentkoc: Recent history for CONTRIBUTING, Windows docs, setup docs, and Node-version docs shows repeated maintenance of the affected documentation surface. (role: recent docs maintainer; confidence: high; commits: 6133d248e20f, 8d1f98ef08cd, 031c3b22deef; files: CONTRIBUTING.md, docs/platforms/windows.md, docs/start/setup.md)
  • @steipete: Recent Windows/setup history includes native Windows vs WSL2 support wording, systemd service references, gateway watch behavior, and Node 22.14 compatibility. (role: Windows and setup docs owner-adjacent maintainer; confidence: medium; commits: 22c1bda2a0fb, 2d0ca7528277, 68ba1e7180a6; files: docs/platforms/windows.md, docs/start/setup.md, README.md)
  • @rubencu: Recent merged docs work clarified the source Control UI dev/build flow that overlaps the PR's quick-start build guidance. (role: source build docs contributor; confidence: medium; commits: 6d427f8c2ac0; files: README.md, docs/start/setup.md)

Remaining risk / open question:

  • Merging the PR as-is would likely duplicate guidance now covered by README.md, docs/platforms/windows.md, and docs/start/setup.md.
  • Some WSL2 tuning notes from the PR are still absent from the canonical setup docs, so closing as implemented would lose potentially useful contributor context.

Codex review notes: model gpt-5.5, reasoning high; reviewed against 388019f5b693.

@alkor2000
Copy link
Copy Markdown
Author

Closing — appreciate the triage feedback. Happy to revisit if maintainers want to re-scope the development environment guidance.

@alkor2000 alkor2000 closed this Apr 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size: XS triage: low-signal-docs Candidate: docs-only change looks low signal; maintainer review needed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants