Skip to content

Commit 932b633

Browse files
authored
Merge branch 'openclaw:main' into main
2 parents fb31832 + 7f1712c commit 932b633

257 files changed

Lines changed: 15528 additions & 3180 deletions

File tree

Some content is hidden

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

.agents/skills/PR_WORKFLOW.md

Lines changed: 48 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
1-
# PR Review Instructions
1+
# PR Workflow for Maintainers
22

33
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.
49

510
## Working rule
611

@@ -9,9 +14,9 @@ Always pause between skills to evaluate technical direction, not just command su
914

1015
These three skills must be used in order:
1116

12-
1. `review-pr`
13-
2. `prepare-pr`
14-
3. `merge-pr`
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
1520

1621
They are necessary, but not sufficient. Maintainers must steer between steps and understand the code before moving forward.
1722

@@ -31,6 +36,43 @@ Do not continue if you cannot verify the problem is real or test the fix.
3136
- Harden changes. Always evaluate security impact and abuse paths.
3237
- Understand the system before changing it. Never make the codebase messier just to clear a PR queue.
3338

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+
3476
## Unified workflow
3577

3678
Entry criteria:
@@ -72,7 +114,7 @@ Stop and escalate instead of continuing if:
72114
Purpose:
73115

74116
- Make the PR merge-ready on its head branch.
75-
- Rebase onto current `main`, fix blocker/important findings, and run gates.
117+
- Rebase onto current `main` first, then fix blocker/important findings, then run gates.
76118

77119
Expected output:
78120

@@ -124,3 +166,4 @@ Maintainer checkpoint after merge:
124166

125167
- Were any refactors intentionally deferred and now need follow-up issue(s)?
126168
- Did this reveal broader architecture or test gaps we should address?
169+
- Run `bun scripts/update-clawtributors.ts` if the contributor is new.

.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=...

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
blank_issues_enabled: true
1+
blank_issues_enabled: false
22
contact_links:
33
- name: Onboarding
44
url: https://discord.gg/clawd
5-
about: New to Clawdbot? Join Discord for setup guidance from Krill in \#help.
5+
about: New to OpenClaw? Join Discord for setup guidance from Krill in \#help.
66
- name: Support
77
url: https://discord.gg/clawd
88
about: Get help from Krill and the community on Discord in \#help.

.github/labeler.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@
99
- "src/discord/**"
1010
- "extensions/discord/**"
1111
- "docs/channels/discord.md"
12+
"channel: irc":
13+
- changed-files:
14+
- any-glob-to-any-file:
15+
- "extensions/irc/**"
16+
- "docs/channels/irc.md"
1217
"channel: feishu":
1318
- changed-files:
1419
- any-glob-to-any-file:

.github/workflows/auto-response.yml

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,11 @@ jobs:
3939
message:
4040
"Please use [our support server](https://discord.gg/clawd) and ask in #help or #users-helping-users to resolve this, or follow the stuck FAQ at https://docs.openclaw.ai/help/faq#im-stuck-whats-the-fastest-way-to-get-unstuck.",
4141
},
42+
{
43+
label: "r: testflight",
44+
close: true,
45+
message: "Not available, build from source.",
46+
},
4247
{
4348
label: "r: third-party-extension",
4449
close: true,
@@ -60,10 +65,36 @@ jobs:
6065
const title = issue.title ?? "";
6166
const body = issue.body ?? "";
6267
const haystack = `${title}\n${body}`.toLowerCase();
63-
const hasLabel = (issue.labels ?? []).some((label) =>
68+
const hasMoltbookLabel = (issue.labels ?? []).some((label) =>
6469
typeof label === "string" ? label === "r: moltbook" : label?.name === "r: moltbook",
6570
);
66-
if (haystack.includes("moltbook") && !hasLabel) {
71+
const hasTestflightLabel = (issue.labels ?? []).some((label) =>
72+
typeof label === "string"
73+
? label === "r: testflight"
74+
: label?.name === "r: testflight",
75+
);
76+
const hasSecurityLabel = (issue.labels ?? []).some((label) =>
77+
typeof label === "string" ? label === "security" : label?.name === "security",
78+
);
79+
if (title.toLowerCase().includes("security") && !hasSecurityLabel) {
80+
await github.rest.issues.addLabels({
81+
owner: context.repo.owner,
82+
repo: context.repo.repo,
83+
issue_number: issue.number,
84+
labels: ["security"],
85+
});
86+
return;
87+
}
88+
if (title.toLowerCase().includes("testflight") && !hasTestflightLabel) {
89+
await github.rest.issues.addLabels({
90+
owner: context.repo.owner,
91+
repo: context.repo.repo,
92+
issue_number: issue.number,
93+
labels: ["r: testflight"],
94+
});
95+
return;
96+
}
97+
if (haystack.includes("moltbook") && !hasMoltbookLabel) {
6798
await github.rest.issues.addLabels({
6899
owner: context.repo.owner,
69100
repo: context.repo.repo,

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,10 +145,10 @@ jobs:
145145
path: dist/
146146
retention-days: 1
147147

148-
# Validate npm pack contents after build.
148+
# Validate npm pack contents after build (only on push to main, not PRs).
149149
release-check:
150150
needs: [docs-scope, build-artifacts]
151-
if: needs.docs-scope.outputs.docs_only != 'true'
151+
if: github.event_name == 'push' && needs.docs-scope.outputs.docs_only != 'true'
152152
runs-on: blacksmith-4vcpu-ubuntu-2404
153153
steps:
154154
- name: Checkout

.github/workflows/docker-release.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@ on:
88
- "v*"
99
paths-ignore:
1010
- "docs/**"
11-
- "*.md"
11+
- "**/*.md"
12+
- "**/*.mdx"
13+
- ".agents/**"
14+
- "skills/**"
1215

1316
env:
1417
REGISTRY: ghcr.io

.github/workflows/stale.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Stale
2+
3+
on:
4+
schedule:
5+
- cron: "17 3 * * *"
6+
workflow_dispatch:
7+
8+
permissions: {}
9+
10+
jobs:
11+
stale:
12+
permissions:
13+
issues: write
14+
pull-requests: write
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/create-github-app-token@d72941d797fd3113feb6b93fd0dec494b13a2547 # v1
18+
id: app-token
19+
with:
20+
app-id: "2729701"
21+
private-key: ${{ secrets.GH_APP_PRIVATE_KEY }}
22+
- name: Mark stale issues and pull requests
23+
uses: actions/stale@v9
24+
with:
25+
repo-token: ${{ steps.app-token.outputs.token }}
26+
days-before-issue-stale: 7
27+
days-before-issue-close: 5
28+
days-before-pr-stale: 5
29+
days-before-pr-close: 3
30+
stale-issue-label: stale
31+
stale-pr-label: stale
32+
exempt-issue-labels: enhancement,maintainer,pinned,security,no-stale
33+
exempt-pr-labels: maintainer,no-stale
34+
operations-per-run: 500
35+
exempt-all-assignees: true
36+
remove-stale-when-updated: true
37+
stale-issue-message: |
38+
This issue has been automatically marked as stale due to inactivity.
39+
Please add updates or it will be closed.
40+
stale-pr-message: |
41+
This pull request has been automatically marked as stale due to inactivity.
42+
Please add updates or it will be closed.
43+
close-issue-message: |
44+
Closing due to inactivity.
45+
If this is still an issue, please retry on the latest OpenClaw release and share updated details.
46+
If you are absolutely sure it still happens on the latest release, open a new issue with fresh repro steps.
47+
close-issue-reason: not_planned
48+
close-pr-message: |
49+
Closing due to inactivity.
50+
If you believe this PR should be revived, post in #pr-thunderdome-dangerzone on Discord to talk to a maintainer.
51+
That channel is the escape hatch for high-quality PRs that get auto-closed.

AGENTS.md

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@
6060
- Type-check/build: `pnpm build`
6161
- TypeScript checks: `pnpm tsgo`
6262
- Lint/format: `pnpm check`
63+
- Format check: `pnpm format` (oxfmt --check)
64+
- Format fix: `pnpm format:fix` (oxfmt --write)
6365
- Tests: `pnpm test` (vitest); coverage: `pnpm test:coverage`
6466

6567
## Coding Style & Naming Conventions
@@ -90,34 +92,18 @@
9092

9193
## Commit & Pull Request Guidelines
9294

95+
**Full maintainer PR workflow:** `.agents/skills/PR_WORKFLOW.md` -- triage order, quality bar, rebase rules, commit/changelog conventions, co-contributor policy, and the 3-step skill pipeline (`review-pr` > `prepare-pr` > `merge-pr`).
96+
9397
- Create commits with `scripts/committer "<msg>" <file...>`; avoid manual `git add`/`git commit` so staging stays scoped.
9498
- Follow concise, action-oriented commit messages (e.g., `CLI: add verbose flag to send`).
9599
- Group related changes; avoid bundling unrelated refactors.
96-
- Changelog workflow: keep latest released version at top (no `Unreleased`); after publishing, bump version and start a new top section.
97-
- PRs should summarize scope, note testing performed, and mention any user-facing changes or new flags.
98100
- Read this when submitting a PR: `docs/help/submitting-a-pr.md` ([Submitting a PR](https://docs.openclaw.ai/help/submitting-a-pr))
99101
- Read this when submitting an issue: `docs/help/submitting-an-issue.md` ([Submitting an Issue](https://docs.openclaw.ai/help/submitting-an-issue))
100-
- PR review flow: when given a PR link, review via `gh pr view`/`gh pr diff` and do **not** change branches.
101-
- PR review calls: prefer a single `gh pr view --json ...` to batch metadata/comments; run `gh pr diff` only when needed.
102-
- 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.
103-
- Goal: merge PRs. Prefer **rebase** when commits are clean; **squash** when history is messy.
104-
- PR merge flow: create a temp branch from `main`, merge the PR branch into it (prefer squash unless commit history is important; use rebase/merge when it is). Always try to merge the PR unless it’s truly difficult, then use another approach. If we squash, add the PR author as a co-contributor. Apply fixes, add changelog entry (include PR # + thanks), run full gate before the final commit, commit, merge back to `main`, delete the temp branch, and end on `main`.
105-
- 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.
106-
- When working on a PR: add a changelog entry with the PR number and thank the contributor.
107-
- When working on an issue: reference the issue in the changelog entry.
108-
- When merging a PR: leave a PR comment that explains exactly what we did and include the SHA hashes.
109-
- When merging a PR from a new contributor: add their avatar to the README “Thanks to all clawtributors” thumbnail list.
110-
- After merging a PR: run `bun scripts/update-clawtributors.ts` if the contributor is missing, then commit the regenerated README.
111102

112103
## Shorthand Commands
113104

114105
- `sync`: if working tree is dirty, commit all changes (pick a sensible Conventional Commit message), then `git pull --rebase`; if rebase conflicts and cannot resolve, stop; otherwise `git push`.
115106

116-
### PR Workflow (Review vs Land)
117-
118-
- **Review mode (PR link only):** read `gh pr view/diff`; **do not** switch branches; **do not** change code.
119-
- **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!
120-
121107
## Security & Configuration Tips
122108

123109
- Web provider stores creds at `~/.openclaw/credentials/`; rerun `openclaw login` if logged out.

0 commit comments

Comments
 (0)