Skip to content

Commit 086d23b

Browse files
Merge branch 'main' into fix/anthropic-oauth-billing-message
2 parents 2d286e8 + 00d0d4b commit 086d23b

272 files changed

Lines changed: 4868 additions & 2347 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/crabbox/SKILL.md‎

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,31 @@ Keep it efficient:
251251
- Include `--timing-json` on broad or flaky runs when command duration or sync
252252
behavior matters.
253253

254+
Before/after PR proof on delegated Testbox:
255+
256+
- For PRs that should prove "broken before, fixed after", compare base and PR
257+
on the same Testbox when practical. Fetch both refs, create detached temp
258+
worktrees under `/tmp`, install in each, then run the same harness twice.
259+
- Do not checkout base/PR refs in the synced repo root. Delegated Testbox sync
260+
may leave the root dirty with local files; `git checkout` can abort or mix
261+
proof state.
262+
- Temp harness files under `/tmp` do not resolve repo packages by default. Put
263+
the harness inside the worktree, or in ESM use
264+
`createRequire(path.join(process.cwd(), "package.json"))` before requiring
265+
workspace deps such as `@lydell/node-pty`.
266+
- For full-screen TUI/CLI bugs, a PTY harness is stronger than helper-only
267+
assertions. Use a real PTY, wait for visible lifecycle markers, send input,
268+
then send control keys and assert process exit/stuck behavior.
269+
- When validating a rebased local branch before push, remember delegated sync
270+
usually validates synced file content on a detached dirty checkout, not a
271+
remote commit object. Record the local head SHA, changed files, Testbox id,
272+
and final success markers; after pushing, ensure the pushed SHA has the same
273+
file content.
274+
- If GitHub CI is still queued but the exact changed content passed Testbox
275+
`pnpm check:changed`, `pnpm check:test-types`, and the real E2E proof, it is
276+
reasonable to merge once required checks allow it. Note any still-running
277+
unrelated shards in the proof comment instead of waiting forever.
278+
254279
Interactive CLI/onboarding:
255280

256281
- For full-screen or prompt-heavy CLI flows, run the target command inside tmux

‎.github/workflows/openclaw-release-publish.yml‎

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ jobs:
288288
wait_for_run() {
289289
local workflow="$1"
290290
local run_id="$2"
291-
local status conclusion url updated_at last_state
291+
local status conclusion url updated_at created_at duration_seconds duration_label last_state
292292
293293
last_state=""
294294
while true; do
@@ -307,11 +307,26 @@ jobs:
307307
sleep 30
308308
done
309309
310-
conclusion="$(gh run view --repo "$GITHUB_REPOSITORY" "$run_id" --json conclusion --jq '.conclusion')"
311-
url="$(gh run view --repo "$GITHUB_REPOSITORY" "$run_id" --json url --jq '.url')"
312-
echo "${workflow} finished with ${conclusion}: ${url}"
310+
run_json="$(gh run view --repo "$GITHUB_REPOSITORY" "$run_id" --json conclusion,url,createdAt,updatedAt)"
311+
conclusion="$(printf '%s' "$run_json" | jq -r '.conclusion')"
312+
url="$(printf '%s' "$run_json" | jq -r '.url')"
313+
created_at="$(printf '%s' "$run_json" | jq -r '.createdAt')"
314+
updated_at="$(printf '%s' "$run_json" | jq -r '.updatedAt')"
315+
duration_seconds="$(
316+
CREATED_AT="${created_at}" UPDATED_AT="${updated_at}" node --input-type=module -e '
317+
const created = Date.parse(process.env.CREATED_AT ?? "");
318+
const updated = Date.parse(process.env.UPDATED_AT ?? "");
319+
console.log(Number.isFinite(created) && Number.isFinite(updated) ? Math.max(0, Math.round((updated - created) / 1000)) : "");
320+
'
321+
)"
322+
if [[ -n "${duration_seconds}" ]]; then
323+
duration_label="$((duration_seconds / 60))m$(printf '%02d' $((duration_seconds % 60)))s"
324+
else
325+
duration_label="unknown duration"
326+
fi
327+
echo "${workflow} finished with ${conclusion} in ${duration_label}: ${url}"
313328
{
314-
echo "- ${workflow}: ${conclusion} (${url})"
329+
echo "- ${workflow}: ${conclusion} in ${duration_label} (${url})"
315330
} >> "$GITHUB_STEP_SUMMARY"
316331
if [[ "$conclusion" != "success" ]]; then
317332
gh run view --repo "$GITHUB_REPOSITORY" "$run_id" --json jobs --jq '.jobs[] | select(.conclusion != "success" and .conclusion != "skipped") | {name, conclusion, url}' || true
@@ -414,6 +429,10 @@ jobs:
414429
415430
plugin_npm_run_id="$(dispatch_workflow plugin-npm-release.yml "${npm_args[@]}")"
416431
plugin_clawhub_run_id="$(dispatch_workflow plugin-clawhub-release.yml "${clawhub_args[@]}")"
432+
{
433+
echo "- Plugin npm run ID: \`${plugin_npm_run_id}\`"
434+
echo "- Plugin ClawHub run ID: \`${plugin_clawhub_run_id}\`"
435+
} >> "$GITHUB_STEP_SUMMARY"
417436
418437
if ! wait_for_run plugin-npm-release.yml "${plugin_npm_run_id}"; then
419438
echo "Plugin npm publish failed; cancelling ClawHub publish child ${plugin_clawhub_run_id}." >&2
@@ -428,6 +447,7 @@ jobs:
428447
-f preflight_only=false \
429448
-f preflight_run_id="${PREFLIGHT_RUN_ID}" \
430449
-f npm_dist_tag="${RELEASE_NPM_DIST_TAG}")"
450+
echo "- OpenClaw npm run ID: \`${openclaw_npm_run_id}\`" >> "$GITHUB_STEP_SUMMARY"
431451
else
432452
echo "- OpenClaw npm publish: skipped by input" >> "$GITHUB_STEP_SUMMARY"
433453
fi

‎.github/workflows/plugin-clawhub-release.yml‎

Lines changed: 88 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,20 @@ jobs:
228228

229229
- name: Install ClawHub CLI dependencies
230230
working-directory: clawhub-source
231-
run: bun install --frozen-lockfile
231+
run: |
232+
set -euo pipefail
233+
for attempt in 1 2 3; do
234+
if bun install --frozen-lockfile; then
235+
exit 0
236+
fi
237+
status="$?"
238+
if [[ "${attempt}" == "3" ]]; then
239+
exit "${status}"
240+
fi
241+
echo "bun install failed while preparing ClawHub CLI; retrying (${attempt}/3)."
242+
rm -rf node_modules "${RUNNER_TEMP}/bun-install-cache" || true
243+
sleep $((attempt * 15))
244+
done
232245
233246
- name: Bootstrap ClawHub CLI
234247
run: |
@@ -263,7 +276,7 @@ jobs:
263276
id-token: write
264277
strategy:
265278
fail-fast: false
266-
max-parallel: 12
279+
max-parallel: 32
267280
matrix:
268281
plugin: ${{ fromJson(needs.preview_plugins_clawhub.outputs.matrix) }}
269282
steps:
@@ -309,7 +322,20 @@ jobs:
309322

310323
- name: Install ClawHub CLI dependencies
311324
working-directory: clawhub-source
312-
run: bun install --frozen-lockfile
325+
run: |
326+
set -euo pipefail
327+
for attempt in 1 2 3; do
328+
if bun install --frozen-lockfile; then
329+
exit 0
330+
fi
331+
status="$?"
332+
if [[ "${attempt}" == "3" ]]; then
333+
exit "${status}"
334+
fi
335+
echo "bun install failed while preparing ClawHub CLI; retrying (${attempt}/3)."
336+
rm -rf node_modules "${RUNNER_TEMP}/bun-install-cache" || true
337+
sleep $((attempt * 15))
338+
done
313339
314340
- name: Bootstrap ClawHub CLI
315341
run: |
@@ -392,3 +418,62 @@ jobs:
392418
PACKAGE_TAG: ${{ matrix.plugin.publishTag }}
393419
PACKAGE_DIR: ${{ matrix.plugin.packageDir }}
394420
run: bash scripts/plugin-clawhub-publish.sh --publish "${PACKAGE_DIR}"
421+
422+
- name: Verify published ClawHub package
423+
env:
424+
CLAWHUB_REGISTRY: ${{ env.CLAWHUB_REGISTRY }}
425+
PACKAGE_NAME: ${{ matrix.plugin.packageName }}
426+
PACKAGE_VERSION: ${{ matrix.plugin.version }}
427+
PACKAGE_TAG: ${{ matrix.plugin.publishTag }}
428+
run: |
429+
set -euo pipefail
430+
node --input-type=module <<'EOF'
431+
const registry = (process.env.CLAWHUB_REGISTRY ?? "https://clawhub.ai").replace(/\/+$/, "");
432+
const packageName = process.env.PACKAGE_NAME;
433+
const packageVersion = process.env.PACKAGE_VERSION;
434+
const packageTag = process.env.PACKAGE_TAG;
435+
if (!packageName || !packageVersion || !packageTag) {
436+
throw new Error("Missing ClawHub package verification env.");
437+
}
438+
const encodedName = encodeURIComponent(packageName);
439+
const encodedVersion = encodeURIComponent(packageVersion);
440+
const detailUrl = `${registry}/api/v1/packages/${encodedName}`;
441+
const versionUrl = `${detailUrl}/versions/${encodedVersion}`;
442+
const artifactUrl = `${versionUrl}/artifact/download`;
443+
444+
async function fetchWithRetry(url, options = {}) {
445+
let lastStatus = "unknown";
446+
for (let attempt = 1; attempt <= 12; attempt += 1) {
447+
const response = await fetch(url, { redirect: "manual", ...options });
448+
lastStatus = response.status;
449+
if (response.status !== 429 && response.status < 500) {
450+
return response;
451+
}
452+
await new Promise((resolve) => setTimeout(resolve, attempt * 5000));
453+
}
454+
throw new Error(`${url} did not stabilize; last status ${lastStatus}.`);
455+
}
456+
457+
const detailResponse = await fetchWithRetry(detailUrl, {
458+
headers: { accept: "application/json" },
459+
});
460+
if (!detailResponse.ok) {
461+
throw new Error(`${detailUrl} returned HTTP ${detailResponse.status}.`);
462+
}
463+
const detail = await detailResponse.json();
464+
const tags = detail?.package?.tags ?? {};
465+
if (tags[packageTag] !== packageVersion) {
466+
throw new Error(
467+
`${packageName}: ClawHub tag ${packageTag} points to ${tags[packageTag] ?? "<missing>"}, expected ${packageVersion}.`,
468+
);
469+
}
470+
const versionResponse = await fetchWithRetry(versionUrl);
471+
if (!versionResponse.ok) {
472+
throw new Error(`${versionUrl} returned HTTP ${versionResponse.status}.`);
473+
}
474+
const artifactResponse = await fetchWithRetry(artifactUrl, { method: "HEAD" });
475+
if (artifactResponse.status < 200 || artifactResponse.status >= 400) {
476+
throw new Error(`${artifactUrl} returned HTTP ${artifactResponse.status}.`);
477+
}
478+
console.log(`${packageName}@${packageVersion} verified on ClawHub.`);
479+
EOF

0 commit comments

Comments
 (0)