Skip to content

Commit 8ff0f1d

Browse files
Merge branch 'openclaw:main' into main
2 parents a3b4b9d + 7f1712c commit 8ff0f1d

File tree

1,120 files changed

+48391
-12830
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,120 files changed

+48391
-12830
lines changed

.agents/skills/PR_WORKFLOW.md

Lines changed: 169 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,169 @@
1+
# PR Workflow for Maintainers
2+
3+
Please read this in full and do not skip sections.
4+
This is the single source of truth for the maintainer PR workflow.
5+
6+
## Triage order
7+
8+
Process PRs **oldest to newest**. Older PRs are more likely to have merge conflicts and stale dependencies; resolving them first keeps the queue healthy and avoids snowballing rebase pain.
9+
10+
## Working rule
11+
12+
Skills execute workflow, maintainers provide judgment.
13+
Always pause between skills to evaluate technical direction, not just command success.
14+
15+
These three skills must be used in order:
16+
17+
1. `review-pr` — review only, produce findings
18+
2. `prepare-pr` — rebase, fix, gate, push to PR head branch
19+
3. `merge-pr` — squash-merge, verify MERGED state, clean up
20+
21+
They are necessary, but not sufficient. Maintainers must steer between steps and understand the code before moving forward.
22+
23+
Treat PRs as reports first, code second.
24+
If submitted code is low quality, ignore it and implement the best solution for the problem.
25+
26+
Do not continue if you cannot verify the problem is real or test the fix.
27+
28+
## PR quality bar
29+
30+
- Do not trust PR code by default.
31+
- Do not merge changes you cannot validate with a reproducible problem and a tested fix.
32+
- Keep types strict. Do not use `any` in implementation code.
33+
- Keep external-input boundaries typed and validated, including CLI input, environment variables, network payloads, and tool output.
34+
- Keep implementations properly scoped. Fix root causes, not local symptoms.
35+
- Identify and reuse canonical sources of truth so behavior does not drift across the codebase.
36+
- Harden changes. Always evaluate security impact and abuse paths.
37+
- Understand the system before changing it. Never make the codebase messier just to clear a PR queue.
38+
39+
## Rebase and conflict resolution
40+
41+
Before any substantive review or prep work, **always rebase the PR branch onto current `main` and resolve merge conflicts first**. A PR that cannot cleanly rebase is not ready for review — fix conflicts before evaluating correctness.
42+
43+
- During `prepare-pr`: rebase onto `main` is the first step, before fixing findings or running gates.
44+
- If conflicts are complex or touch areas you do not understand, stop and escalate.
45+
- Prefer **rebase** for linear history; **squash** when commit history is messy or unhelpful.
46+
47+
## Commit and changelog rules
48+
49+
- Create commits with `scripts/committer "<msg>" <file...>`; avoid manual `git add`/`git commit` so staging stays scoped.
50+
- Follow concise, action-oriented commit messages (e.g., `CLI: add verbose flag to send`).
51+
- Group related changes; avoid bundling unrelated refactors.
52+
- Changelog workflow: keep latest released version at top (no `Unreleased`); after publishing, bump version and start a new top section.
53+
- When working on a PR: add a changelog entry with the PR number and thank the contributor.
54+
- When working on an issue: reference the issue in the changelog entry.
55+
- Pure test additions/fixes generally do **not** need a changelog entry unless they alter user-facing behavior or the user asks for one.
56+
57+
## Co-contributor and clawtributors
58+
59+
- If we squash, add the PR author as a co-contributor in the commit.
60+
- If you review a PR and later do work on it, land via merge/squash (no direct-main commits) and always add the PR author as a co-contributor.
61+
- When merging a PR: leave a PR comment that explains exactly what we did and include the SHA hashes.
62+
- When merging a PR from a new contributor: run `bun scripts/update-clawtributors.ts` to add their avatar to the README "Thanks to all clawtributors" list, then commit the regenerated README.
63+
64+
## Review mode vs landing mode
65+
66+
- **Review mode (PR link only):** read `gh pr view`/`gh pr diff`; **do not** switch branches; **do not** change code.
67+
- **Landing mode:** create an integration branch from `main`, bring in PR commits (**prefer rebase** for linear history; **merge allowed** when complexity/conflicts make it safer), apply fixes, add changelog (+ thanks + PR #), run full gate **locally before committing** (`pnpm build && pnpm check && pnpm test`), commit, merge back to `main`, then `git switch main` (never stay on a topic branch after landing). Important: contributor needs to be in git graph after this!
68+
69+
## Pre-review safety checks
70+
71+
- Before starting a review when a GH Issue/PR is pasted: run `git pull`; if there are local changes or unpushed commits, stop and alert the user before reviewing.
72+
- PR review calls: prefer a single `gh pr view --json ...` to batch metadata/comments; run `gh pr diff` only when needed.
73+
- PRs should summarize scope, note testing performed, and mention any user-facing changes or new flags.
74+
- Read `docs/help/submitting-a-pr.md` ([Submitting a PR](https://docs.openclaw.ai/help/submitting-a-pr)) for what we expect from contributors.
75+
76+
## Unified workflow
77+
78+
Entry criteria:
79+
80+
- PR URL/number is known.
81+
- Problem statement is clear enough to attempt reproduction.
82+
- A realistic verification path exists (tests, integration checks, or explicit manual validation).
83+
84+
### 1) `review-pr`
85+
86+
Purpose:
87+
88+
- Review only: correctness, value, security risk, tests, docs, and changelog impact.
89+
- Produce structured findings and a recommendation.
90+
91+
Expected output:
92+
93+
- Recommendation: ready, needs work, needs discussion, or close.
94+
- `.local/review.md` with actionable findings.
95+
96+
Maintainer checkpoint before `prepare-pr`:
97+
98+
```
99+
What problem are they trying to solve?
100+
What is the most optimal implementation?
101+
Is the code properly scoped?
102+
Can we fix up everything?
103+
Do we have any questions?
104+
```
105+
106+
Stop and escalate instead of continuing if:
107+
108+
- The problem cannot be reproduced or confirmed.
109+
- The proposed PR scope does not match the stated problem.
110+
- The design introduces unresolved security or trust-boundary concerns.
111+
112+
### 2) `prepare-pr`
113+
114+
Purpose:
115+
116+
- Make the PR merge-ready on its head branch.
117+
- Rebase onto current `main` first, then fix blocker/important findings, then run gates.
118+
119+
Expected output:
120+
121+
- Updated code and tests on the PR head branch.
122+
- `.local/prep.md` with changes, verification, and current HEAD SHA.
123+
- Final status: `PR is ready for /mergepr`.
124+
125+
Maintainer checkpoint before `merge-pr`:
126+
127+
```
128+
Is this the most optimal implementation?
129+
Is the code properly scoped?
130+
Is the code properly typed?
131+
Is the code hardened?
132+
Do we have enough tests?
133+
Are tests using fake timers where relevant? (e.g., debounce/throttle, retry backoff, timeout branches, delayed callbacks, polling loops)
134+
Do not add performative tests, ensure tests are real and there are no regressions.
135+
Take your time, fix it properly, refactor if necessary.
136+
Do you see any follow-up refactors we should do?
137+
Did any changes introduce any potential security vulnerabilities?
138+
```
139+
140+
Stop and escalate instead of continuing if:
141+
142+
- You cannot verify behavior changes with meaningful tests or validation.
143+
- Fixing findings requires broad architecture changes outside safe PR scope.
144+
- Security hardening requirements remain unresolved.
145+
146+
### 3) `merge-pr`
147+
148+
Purpose:
149+
150+
- Merge only after review and prep artifacts are present and checks are green.
151+
- Use squash merge flow and verify the PR ends in `MERGED` state.
152+
153+
Go or no-go checklist before merge:
154+
155+
- All BLOCKER and IMPORTANT findings are resolved.
156+
- Verification is meaningful and regression risk is acceptably low.
157+
- Docs and changelog are updated when required.
158+
- Required CI checks are green and the branch is not behind `main`.
159+
160+
Expected output:
161+
162+
- Successful merge commit and recorded merge SHA.
163+
- Worktree cleanup after successful merge.
164+
165+
Maintainer checkpoint after merge:
166+
167+
- Were any refactors intentionally deferred and now need follow-up issue(s)?
168+
- Did this reveal broader architecture or test gaps we should address?
169+
- Run `bun scripts/update-clawtributors.ts` if the contributor is new.

.agents/skills/merge-pr/SKILL.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Merge a prepared PR via `gh pr merge --squash` and clean up the worktree after s
2828

2929
## Known Footguns
3030

31-
- If you see "fatal: not a git repository", you are in the wrong directory. Use `~/Development/openclaw`, not `~/openclaw`.
31+
- If you see "fatal: not a git repository", you are in the wrong directory. Use `~/dev/openclaw` if available; otherwise ask user.
3232
- Read `.local/review.md` and `.local/prep.md` in the worktree. Do not skip.
3333
- Clean up the real worktree directory `.worktrees/pr-<PR>` only after a successful merge.
3434
- Expect cleanup to remove `.local/` artifacts.
@@ -49,7 +49,7 @@ Create a checklist of all merge steps, print it, then continue and execute the c
4949
Use an isolated worktree for all merge work.
5050

5151
```sh
52-
cd ~/Development/openclaw
52+
cd ~/dev/openclaw
5353
# Sanity: confirm you are in the repo
5454
git rev-parse --show-toplevel
5555

@@ -104,6 +104,8 @@ Stop if any are true:
104104
- Required checks are failing.
105105
- Branch is behind main.
106106

107+
If `.local/prep.md` contains `Docs-only change detected with high confidence; skipping pnpm test.`, that local test skip is allowed. CI checks still must be green.
108+
107109
```sh
108110
# Checks
109111
gh pr checks <PR>
@@ -167,7 +169,7 @@ gh pr view <PR> --json state --jq .state
167169
Run cleanup only if step 6 returned `MERGED`.
168170

169171
```sh
170-
cd ~/Development/openclaw
172+
cd ~/dev/openclaw
171173

172174
git worktree remove ".worktrees/pr-<PR>" --force
173175

.agents/skills/prepare-pr/SKILL.md

Lines changed: 35 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,15 @@ Prepare a PR branch for merge with review fixes, green gates, and an updated hea
3030

3131
## Known Footguns
3232

33-
- If you see "fatal: not a git repository", you are in the wrong directory. Use `~/openclaw`.
33+
- If you see "fatal: not a git repository", you are in the wrong directory. Use `~/dev/openclaw` if available; otherwise ask user.
3434
- Do not run `git clean -fdx`.
3535
- Do not run `git add -A` or `git add .`.
3636

3737
## Completion Criteria
3838

3939
- Rebase PR commits onto `origin/main`.
4040
- Fix all BLOCKER and IMPORTANT items from `.local/review.md`.
41-
- Run gates and pass.
41+
- Run required gates and pass (docs-only PRs may skip `pnpm test` when high-confidence docs-only criteria are met and documented).
4242
- Commit prep changes.
4343
- Push the updated HEAD back to the PR head branch.
4444
- Write `.local/prep.md` with a prep summary.
@@ -163,17 +163,46 @@ If `committer` is not found:
163163
git commit -m "fix: <summary> (#<PR>) (thanks @$contrib)"
164164
```
165165

166-
8. Run full gates before pushing
166+
8. Decide verification mode and run required gates before pushing
167+
168+
If you are highly confident the change is docs-only, you may skip `pnpm test`.
169+
170+
High-confidence docs-only criteria (all must be true):
171+
172+
- Every changed file is documentation-only (`docs/**`, `README*.md`, `CHANGELOG.md`, `*.md`, `*.mdx`, `mintlify.json`, `docs.json`).
173+
- No code, runtime, test, dependency, or build config files changed (`src/**`, `extensions/**`, `apps/**`, `package.json`, lockfiles, TS/JS config, test files, scripts).
174+
- `.local/review.md` does not call for non-doc behavior fixes.
175+
176+
Suggested check:
177+
178+
```sh
179+
changed_files=$(git diff --name-only origin/main...HEAD)
180+
non_docs=$(printf "%s\n" "$changed_files" | grep -Ev '^(docs/|README.*\.md$|CHANGELOG\.md$|.*\.md$|.*\.mdx$|mintlify\.json$|docs\.json$)' || true)
181+
182+
docs_only=false
183+
if [ -n "$changed_files" ] && [ -z "$non_docs" ]; then
184+
docs_only=true
185+
fi
186+
187+
echo "docs_only=$docs_only"
188+
```
189+
190+
Run required gates:
167191

168192
```sh
169193
pnpm install
170194
pnpm build
171195
pnpm ui:build
172196
pnpm check
173-
pnpm test
197+
198+
if [ "$docs_only" = "true" ]; then
199+
echo "Docs-only change detected with high confidence; skipping pnpm test." | tee -a .local/prep.md
200+
else
201+
pnpm test
202+
fi
174203
```
175204

176-
Require all to pass. If something fails, fix, commit, and rerun. Allow at most 3 fix and rerun cycles. If gates still fail after 3 attempts, stop and report the failures. Do not loop indefinitely.
205+
Require all required gates to pass. If something fails, fix, commit, and rerun. Allow at most 3 fix and rerun cycles. If gates still fail after 3 attempts, stop and report the failures. Do not loop indefinitely.
177206

178207
9. Push updates back to the PR head branch
179208

@@ -245,4 +274,4 @@ Otherwise, list remaining failures and stop.
245274
- Do not delete the worktree on success. `/mergepr` may reuse it.
246275
- Do not run `gh pr merge`.
247276
- Never push to main. Only push to the PR head branch.
248-
- Run and pass all gates before pushing.
277+
- Run and pass all required gates before pushing. `pnpm test` may be skipped only for high-confidence docs-only changes, and the skip must be explicitly recorded in `.local/prep.md`.

.agents/skills/review-pr/SKILL.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Perform a thorough review-only PR assessment and return a structured recommendat
2828

2929
## Known Failure Modes
3030

31-
- If you see "fatal: not a git repository", you are in the wrong directory. Use `~/openclaw`.
31+
- If you see "fatal: not a git repository", you are in the wrong directory. Use `~/dev/openclaw` if available; otherwise ask user.
3232
- Do not stop after printing the checklist. That is not completion.
3333

3434
## Writing Style for Output
@@ -51,7 +51,7 @@ Create a checklist of all review steps, print it, then continue and execute the
5151
Use an isolated worktree for all review work.
5252

5353
```sh
54-
cd ~/Development/openclaw
54+
cd ~/dev/openclaw
5555
# Sanity: confirm you are in the repo
5656
git rev-parse --show-toplevel
5757

.dockerignore

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,15 @@ Swabble/
4646
Core/
4747
Users/
4848
vendor/
49+
50+
# Needed for building the Canvas A2UI bundle during Docker image builds.
51+
# Keep the rest of apps/ and vendor/ excluded to avoid a large build context.
52+
!apps/shared/
53+
!apps/shared/OpenClawKit/
54+
!apps/shared/OpenClawKit/Tools/
55+
!apps/shared/OpenClawKit/Tools/CanvasA2UI/
56+
!apps/shared/OpenClawKit/Tools/CanvasA2UI/**
57+
!vendor/a2ui/
58+
!vendor/a2ui/renderers/
59+
!vendor/a2ui/renderers/lit/
60+
!vendor/a2ui/renderers/lit/**

.env.example

Lines changed: 70 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,70 @@
1-
# Copy to .env and fill with your Twilio credentials
2-
TWILIO_ACCOUNT_SID=ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
3-
TWILIO_AUTH_TOKEN=your_auth_token_here
4-
# Must be a WhatsApp-enabled Twilio number, prefixed with whatsapp:
5-
TWILIO_WHATSAPP_FROM=whatsapp:+17343367101
1+
# OpenClaw .env example
2+
#
3+
# Quick start:
4+
# 1) Copy this file to `.env` (for local runs from this repo), OR to `~/.openclaw/.env` (for launchd/systemd daemons).
5+
# 2) Fill only the values you use.
6+
# 3) Keep real secrets out of git.
7+
#
8+
# Env-source precedence for environment variables (highest -> lowest):
9+
# process env, ./.env, ~/.openclaw/.env, then openclaw.json `env` block.
10+
# Existing non-empty process env vars are not overridden by dotenv/config env loading.
11+
# Note: direct config keys (for example `gateway.auth.token` or channel tokens in openclaw.json)
12+
# are resolved separately from env loading and often take precedence over env fallbacks.
13+
14+
# -----------------------------------------------------------------------------
15+
# Gateway auth + paths
16+
# -----------------------------------------------------------------------------
17+
# Recommended if the gateway binds beyond loopback.
18+
OPENCLAW_GATEWAY_TOKEN=change-me-to-a-long-random-token
19+
# Example generator: openssl rand -hex 32
20+
21+
# Optional alternative auth mode (use token OR password).
22+
# OPENCLAW_GATEWAY_PASSWORD=change-me-to-a-strong-password
23+
24+
# Optional path overrides (defaults shown for reference).
25+
# OPENCLAW_STATE_DIR=~/.openclaw
26+
# OPENCLAW_CONFIG_PATH=~/.openclaw/openclaw.json
27+
# OPENCLAW_HOME=~
28+
29+
# Optional: import missing keys from your login shell profile.
30+
# OPENCLAW_LOAD_SHELL_ENV=1
31+
# OPENCLAW_SHELL_ENV_TIMEOUT_MS=15000
32+
33+
# -----------------------------------------------------------------------------
34+
# Model provider API keys (set at least one)
35+
# -----------------------------------------------------------------------------
36+
# OPENAI_API_KEY=sk-...
37+
# ANTHROPIC_API_KEY=sk-ant-...
38+
# GEMINI_API_KEY=...
39+
# OPENROUTER_API_KEY=sk-or-...
40+
41+
# Optional additional providers
42+
# ZAI_API_KEY=...
43+
# AI_GATEWAY_API_KEY=...
44+
# MINIMAX_API_KEY=...
45+
# SYNTHETIC_API_KEY=...
46+
47+
# -----------------------------------------------------------------------------
48+
# Channels (only set what you enable)
49+
# -----------------------------------------------------------------------------
50+
# TELEGRAM_BOT_TOKEN=123456:ABCDEF...
51+
# DISCORD_BOT_TOKEN=...
52+
# SLACK_BOT_TOKEN=xoxb-...
53+
# SLACK_APP_TOKEN=xapp-...
54+
55+
# Optional channel env fallbacks
56+
# MATTERMOST_BOT_TOKEN=...
57+
# MATTERMOST_URL=https://chat.example.com
58+
# ZALO_BOT_TOKEN=...
59+
# OPENCLAW_TWITCH_ACCESS_TOKEN=oauth:...
60+
61+
# -----------------------------------------------------------------------------
62+
# Tools + voice/media (optional)
63+
# -----------------------------------------------------------------------------
64+
# BRAVE_API_KEY=...
65+
# PERPLEXITY_API_KEY=pplx-...
66+
# FIRECRAWL_API_KEY=...
67+
68+
# ELEVENLABS_API_KEY=...
69+
# XI_API_KEY=... # alias for ElevenLabs
70+
# DEEPGRAM_API_KEY=...

0 commit comments

Comments
 (0)