Skip to content

Commit 7f03dfe

Browse files
committed
Merge remote-tracking branch 'upstream/main'
# Conflicts: # package.json # src/auto-reply/reply/agent-runner.ts
2 parents 42c14c8 + 805de85 commit 7f03dfe

File tree

2,552 files changed

+169887
-55189
lines changed

Some content is hidden

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

2,552 files changed

+169887
-55189
lines changed

.dockerignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,10 @@ vendor/
5151
# Keep the rest of apps/ and vendor/ excluded to avoid a large build context.
5252
!apps/shared/
5353
!apps/shared/OpenClawKit/
54+
!apps/shared/OpenClawKit/Sources/
55+
!apps/shared/OpenClawKit/Sources/OpenClawKit/
56+
!apps/shared/OpenClawKit/Sources/OpenClawKit/Resources/
57+
!apps/shared/OpenClawKit/Sources/OpenClawKit/Resources/tool-display.json
5458
!apps/shared/OpenClawKit/Tools/
5559
!apps/shared/OpenClawKit/Tools/CanvasA2UI/
5660
!apps/shared/OpenClawKit/Tools/CanvasA2UI/**

.github/ISSUE_TEMPLATE/bug_report.yml

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: Bug report
2-
description: Report a defect or unexpected behavior in OpenClaw.
2+
description: Report defects, including regressions, crashes, and behavior bugs.
33
title: "[Bug]: "
44
labels:
55
- bug
@@ -8,6 +8,17 @@ body:
88
attributes:
99
value: |
1010
Thanks for filing this report. Keep it concise, reproducible, and evidence-based.
11+
- type: dropdown
12+
id: bug_type
13+
attributes:
14+
label: Bug type
15+
description: Choose the category that best matches this report.
16+
options:
17+
- Regression (worked before, now fails)
18+
- Crash (process/app exits or hangs)
19+
- Behavior bug (incorrect output/state without crash)
20+
validations:
21+
required: true
1122
- type: textarea
1223
id: summary
1324
attributes:
@@ -91,5 +102,5 @@ body:
91102
id: additional_information
92103
attributes:
93104
label: Additional information
94-
description: Add any context that helps triage but does not fit above.
95-
placeholder: Regression started after upgrade from <previous-version>; temporary workaround is ...
105+
description: Add any context that helps triage but does not fit above. If this is a regression, include the last known good and first known bad versions.
106+
placeholder: Last known good version <...>, first known bad version <...>, temporary workaround is ...

.github/actions/setup-node-env/action.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ inputs:
1515
description: Whether to install Bun alongside Node.
1616
required: false
1717
default: "true"
18+
use-sticky-disk:
19+
description: Use Blacksmith sticky disks for pnpm store caching.
20+
required: false
21+
default: "false"
1822
frozen-lockfile:
1923
description: Whether to use --frozen-lockfile for install.
2024
required: false
@@ -47,6 +51,7 @@ runs:
4751
with:
4852
pnpm-version: ${{ inputs.pnpm-version }}
4953
cache-key-suffix: "node22"
54+
use-sticky-disk: ${{ inputs.use-sticky-disk }}
5055

5156
- name: Setup Bun
5257
if: inputs.install-bun == 'true'

.github/actions/setup-pnpm-store-cache/action.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ inputs:
99
description: Suffix appended to the cache key.
1010
required: false
1111
default: "node22"
12+
use-sticky-disk:
13+
description: Use Blacksmith sticky disks instead of actions/cache for pnpm store.
14+
required: false
15+
default: "false"
1216
runs:
1317
using: composite
1418
steps:
@@ -38,7 +42,15 @@ runs:
3842
shell: bash
3943
run: echo "path=$(pnpm store path --silent)" >> "$GITHUB_OUTPUT"
4044

45+
- name: Mount pnpm store sticky disk
46+
if: inputs.use-sticky-disk == 'true'
47+
uses: useblacksmith/stickydisk@v1
48+
with:
49+
key: ${{ github.repository }}-pnpm-store-${{ runner.os }}-${{ inputs.cache-key-suffix }}
50+
path: ${{ steps.pnpm-store.outputs.path }}
51+
4152
- name: Restore pnpm store cache
53+
if: inputs.use-sticky-disk != 'true'
4254
uses: actions/cache@v4
4355
with:
4456
path: ${{ steps.pnpm-store.outputs.path }}

.github/workflows/auto-response.yml

Lines changed: 120 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,20 @@ jobs:
1919
steps:
2020
- uses: actions/create-github-app-token@d72941d797fd3113feb6b93fd0dec494b13a2547 # v1
2121
id: app-token
22+
continue-on-error: true
2223
with:
2324
app-id: "2729701"
2425
private-key: ${{ secrets.GH_APP_PRIVATE_KEY }}
26+
- uses: actions/create-github-app-token@d72941d797fd3113feb6b93fd0dec494b13a2547 # v1
27+
id: app-token-fallback
28+
if: steps.app-token.outcome == 'failure'
29+
with:
30+
app-id: "2971289"
31+
private-key: ${{ secrets.GH_APP_PRIVATE_KEY_FALLBACK }}
2532
- name: Handle labeled items
2633
uses: actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b # v7
2734
with:
28-
github-token: ${{ steps.app-token.outputs.token }}
35+
github-token: ${{ steps.app-token.outputs.token || steps.app-token-fallback.outputs.token }}
2936
script: |
3037
// Labels prefixed with "r:" are auto-response triggers.
3138
const rules = [
@@ -70,6 +77,116 @@ jobs:
7077
const mentionRegex = /@([A-Za-z0-9-]+)/g;
7178
const maintainerCache = new Map();
7279
const normalizeLogin = (login) => login.toLowerCase();
80+
const bugSubtypeLabelSpecs = {
81+
regression: {
82+
color: "D93F0B",
83+
description: "Behavior that previously worked and now fails",
84+
},
85+
"bug:crash": {
86+
color: "B60205",
87+
description: "Process/app exits unexpectedly or hangs",
88+
},
89+
"bug:behavior": {
90+
color: "D73A4A",
91+
description: "Incorrect behavior without a crash",
92+
},
93+
};
94+
const bugTypeToLabel = {
95+
"Regression (worked before, now fails)": "regression",
96+
"Crash (process/app exits or hangs)": "bug:crash",
97+
"Behavior bug (incorrect output/state without crash)": "bug:behavior",
98+
};
99+
const bugSubtypeLabels = Object.keys(bugSubtypeLabelSpecs);
100+
101+
const extractIssueFormValue = (body, field) => {
102+
if (!body) {
103+
return "";
104+
}
105+
const escapedField = field.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
106+
const regex = new RegExp(
107+
`(?:^|\\n)###\\s+${escapedField}\\s*\\n([\\s\\S]*?)(?=\\n###\\s+|$)`,
108+
"i",
109+
);
110+
const match = body.match(regex);
111+
if (!match) {
112+
return "";
113+
}
114+
for (const line of match[1].split("\n")) {
115+
const trimmed = line.trim();
116+
if (trimmed) {
117+
return trimmed;
118+
}
119+
}
120+
return "";
121+
};
122+
123+
const ensureLabelExists = async (name, color, description) => {
124+
try {
125+
await github.rest.issues.getLabel({
126+
owner: context.repo.owner,
127+
repo: context.repo.repo,
128+
name,
129+
});
130+
} catch (error) {
131+
if (error?.status !== 404) {
132+
throw error;
133+
}
134+
await github.rest.issues.createLabel({
135+
owner: context.repo.owner,
136+
repo: context.repo.repo,
137+
name,
138+
color,
139+
description,
140+
});
141+
}
142+
};
143+
144+
const syncBugSubtypeLabel = async (issue, labelSet) => {
145+
if (!labelSet.has("bug")) {
146+
return;
147+
}
148+
149+
const selectedBugType = extractIssueFormValue(issue.body ?? "", "Bug type");
150+
const targetLabel = bugTypeToLabel[selectedBugType];
151+
if (!targetLabel) {
152+
return;
153+
}
154+
155+
const targetSpec = bugSubtypeLabelSpecs[targetLabel];
156+
await ensureLabelExists(targetLabel, targetSpec.color, targetSpec.description);
157+
158+
for (const subtypeLabel of bugSubtypeLabels) {
159+
if (subtypeLabel === targetLabel) {
160+
continue;
161+
}
162+
if (!labelSet.has(subtypeLabel)) {
163+
continue;
164+
}
165+
try {
166+
await github.rest.issues.removeLabel({
167+
owner: context.repo.owner,
168+
repo: context.repo.repo,
169+
issue_number: issue.number,
170+
name: subtypeLabel,
171+
});
172+
labelSet.delete(subtypeLabel);
173+
} catch (error) {
174+
if (error?.status !== 404) {
175+
throw error;
176+
}
177+
}
178+
}
179+
180+
if (!labelSet.has(targetLabel)) {
181+
await github.rest.issues.addLabels({
182+
owner: context.repo.owner,
183+
repo: context.repo.repo,
184+
issue_number: issue.number,
185+
labels: [targetLabel],
186+
});
187+
labelSet.add(targetLabel);
188+
}
189+
};
73190
74191
const isMaintainer = async (login) => {
75192
if (!login) {
@@ -194,6 +311,8 @@ jobs:
194311
body: pingWarningMessage,
195312
});
196313
}
314+
315+
await syncBugSubtypeLabel(issue, labelSet);
197316
}
198317
}
199318

0 commit comments

Comments
 (0)