Skip to content

Commit 9bd6e84

Browse files
authored
Merge branch 'main' into fix/tui-ctrlc-cancel-hint
2 parents c9dcef0 + 35264ca commit 9bd6e84

3,096 files changed

Lines changed: 198488 additions & 66455 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/blacksmith-testbox/SKILL.md

Lines changed: 43 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -123,17 +123,22 @@ instantly and boots the CI environment in the background while you work:
123123
blacksmith testbox warmup ci-check-testbox.yml
124124
# → tbx_01jkz5b3t9...
125125

126-
Save this ID. You need it for every `run` command.
126+
Save this ID in the current session. You need it for every `run` command.
127+
Treat `blacksmith testbox list` as diagnostics, not a reusable work queue.
128+
Listed boxes can be visible at the org/repo level while still being unusable or
129+
stale for the current local agent lane.
127130

128131
For OpenClaw maintainer Testbox mode, pre-warm at the start of longer or wider
129132
tasks:
130133

131134
blacksmith testbox warmup ci-check-testbox.yml --ref main --idle-timeout 90
135+
pnpm testbox:claim --id <ID>
132136

133137
Use the build-artifact warmup when e2e/package/build proof benefits from seeded
134138
`dist/`, `dist-runtime/`, and build-all caches:
135139

136140
blacksmith testbox warmup ci-build-artifacts-testbox.yml --ref main --idle-timeout 90
141+
pnpm testbox:claim --id <ID>
137142

138143
Warmup dispatches a GitHub Actions workflow that provisions a VM with the
139144
full CI environment: dependencies installed, services started, secrets
@@ -178,6 +183,26 @@ The `run` command automatically waits for the testbox to become ready if
178183
it is still booting, so you can call `run` immediately after warmup without
179184
needing to check status first.
180185

186+
In OpenClaw, prefer the guarded runner wrapper so stale/reused ids fail before
187+
the Blacksmith CLI spends time syncing or emits a confusing missing-key error:
188+
189+
pnpm testbox:run --id <ID> -- "OPENCLAW_TESTBOX=1 pnpm check:changed"
190+
191+
The wrapper refuses to run when the local per-Testbox key is missing or when the
192+
id was not claimed by this OpenClaw checkout with `pnpm testbox:claim --id
193+
<ID>`. Treat that as the expected remediation, not as a GitHub account or
194+
normal SSH-key problem. A local key alone is not enough; a ready box may still
195+
carry stale rsync state from another lane.
196+
197+
If the agent crashes, the remote box relies on Blacksmith's idle timeout. The
198+
local OpenClaw claim marker is not deleted automatically, so the wrapper treats
199+
claims older than 12 hours as stale. Override only for intentional long-running
200+
work with `OPENCLAW_TESTBOX_CLAIM_TTL_MINUTES=<minutes>`.
201+
202+
Before spending a broad gate on a manually assembled command, you can also run:
203+
204+
pnpm testbox:sanity -- --id <ID>
205+
181206
## Downloading files from a testbox
182207

183208
Use the `download` command to retrieve files or directories from a running
@@ -286,16 +311,23 @@ checks that need parity or remote state.
286311
1. Decide whether the repo's local loop is the right default. For OpenClaw,
287312
`OPENCLAW_TESTBOX=1` makes Testbox the maintainer default.
288313
2. If Testbox is warranted, warm up early:
289-
`blacksmith testbox warmup ci-check-testbox.yml --ref main --idle-timeout 90` → save the ID
314+
`blacksmith testbox warmup ci-check-testbox.yml --ref main --idle-timeout 90` → save the ID,
315+
then `pnpm testbox:claim --id <ID>`
290316
3. Write code while the testbox boots in the background.
291317
4. Run the remote command when needed:
292-
`blacksmith testbox run --id <ID> "pnpm check:changed"`
318+
`pnpm testbox:run --id <ID> -- "OPENCLAW_TESTBOX=1 pnpm check:changed"`
293319
5. If tests fail, fix code and re-run against the same warm box.
294320
6. If you changed dependency manifests (package.json, etc.), prepend
295321
the install command: `blacksmith testbox run --id <ID> "npm install && npm test"`
296-
7. If you need artifacts (coverage reports, build outputs, etc.), download them:
322+
7. If a narrow PR reports a full sync or the box was reused/expired, sanity
323+
check the remote copy before a slow gate:
324+
`pnpm testbox:run --id <ID> -- "pnpm testbox:sanity"`.
325+
If it reports missing root files or mass tracked deletions, stop the box and
326+
warm a fresh one. Use `OPENCLAW_TESTBOX_ALLOW_MASS_DELETIONS=1` only for an
327+
intentional large deletion PR.
328+
8. If you need artifacts (coverage reports, build outputs, etc.), download them:
297329
`blacksmith testbox download --id <ID> coverage/ ./coverage/`
298-
8. Once green, commit and push.
330+
9. Once green, commit and push.
299331

300332
## OpenClaw full test suite
301333

@@ -314,6 +346,12 @@ When validating before commit/push in maintainer Testbox mode, run
314346
`pnpm check:changed` inside the warmed box first when appropriate, then the full
315347
suite with the profile above if broad confidence is needed.
316348

349+
Run `pnpm testbox:sanity` inside the warmed box before the broad command when
350+
the sync looks suspicious. It checks that root files such as `pnpm-lock.yaml`
351+
still exist and fails on 200 or more tracked deletions. That catches stale or
352+
corrupted rsync state before dependency install or Vitest failures hide the real
353+
problem.
354+
317355
## Examples
318356

319357
blacksmith testbox warmup ci-check-testbox.yml

0 commit comments

Comments
 (0)