




























@@ -10,8 +10,9 @@ description: Run Blacksmith Testbox for CI-parity checks, secrets, hosted servic
1010Use Testbox when you need remote CI parity, injected secrets, hosted services,
1111or an OS/runtime image that your local machine cannot provide cheaply.
121213-Do not default to Testbox for every local test/build loop. If the repo has
14-documented local commands for normal iteration, use those first so you keep
13+Do not default to Testbox for every local test/build loop unless the repo or
14+the user's personal maintainer rules explicitly say Testbox-first. If the repo
15+has documented local commands for normal iteration, use those first so you keep
1516warm caches, local build state, and fast feedback.
16171718Testbox is the expensive path. Reach for it deliberately.
@@ -81,17 +82,20 @@ Prefer Testbox when:
8182- you are reproducing CI-only failures
8283- you need the exact workflow image/job environment from GitHub Actions
838484-For OpenClaw specifically, normal local iteration should stay local:
85+For OpenClaw specifically, contributor and routine local iteration should stay
86+local:
85878688- `pnpm check:changed`
8789- `pnpm test:changed`
8890- `pnpm test <path-or-filter>`
8991- `pnpm test:serial`
9092- `pnpm build`
919392-Only use Testbox in OpenClaw when the user explicitly wants CI-parity or the
93-check truly depends on remote secrets/services that the local repo loop cannot
94-provide.
94+OpenClaw maintainer mode is different. If the user has Blacksmith access and
95+sets `OPENCLAW_TESTBOX=1`, or their personal agent rules say Testbox-first,
96+route broad, slow, Docker, live, E2E, full-suite, and CI-parity validation
97+through Testbox by default. `OPENCLAW_LOCAL_CHECK_MODE=throttled` remains the
98+escape hatch for laptop-friendly local proof.
959996100For installable-package product proof, prefer the GitHub `Package Acceptance`
97101workflow over an ad hoc Testbox command. It resolves one package candidate
@@ -111,13 +115,35 @@ an ID instantly and boots the CI environment in the background while you work:
111115112116Save this ID. You need it for every `run` command.
113117118+For long-ish OpenClaw maintainer tasks in Testbox mode, pre-warm at the start
119+with a longer idle timeout:
120+121+blacksmith testbox warmup ci-check-testbox.yml --idle-timeout 90
122+# → tbx_01jkz5b3t9...
123+124+The CLI and current docs expose `--idle-timeout <minutes>` and document the
125+default as 30 minutes, but do not publish a universal maximum. OpenClaw policy:
126+use `90` for normal long-ish tasks, `240` for multi-hour work, `720` for
127+all-day work, and `1440` for overnight work. Anything above `1440` minutes
128+requires explicit user intent and an end-of-task cleanup check.
129+130+Observed on 2026-04-27: Blacksmith accepted `90`, `240`, `720`, `1440`,
131+`4320`, `10080`, `43200`, and even `525600` minutes, with every probe box
132+stopped immediately. Treat that as "no sane visible cap", not permission to
133+leave giant-idle boxes around.
134+135+Choose the warmup ref deliberately. `--ref <branch|tag|sha>` can point at a
136+branch, tag, or SHA. For cache seeding, prefer exact current branch/SHA for
137+correctness; use the latest `beta` or `latest` release SHA only as a warm cache
138+seed, then still run the build/check that proves local synced changes.
139+114140Warmup dispatches a GitHub Actions workflow that provisions a VM with the
115141full CI environment: dependencies installed, services started, secrets
116142injected, and a clean checkout of the repo at the default branch.
117143118144Options:
119145120---ref <branch> Git ref to dispatch against (default: repo's default branch)
146+--ref <branch|tag|sha> Git ref to dispatch against (default: repo's default branch)
121147--job <name> Specific job within the workflow (if it has multiple)
122148--idle-timeout <min> Idle timeout in minutes (default: 30)
123149@@ -250,18 +276,27 @@ checks that need parity or remote state.
250276251277## Workflow
252278253-1. Decide whether the repo's local loop is the right default.
279+1. Decide whether the repo's local loop or maintainer Testbox mode is the right
280+ default.
2542812. Only if Testbox is warranted, warm up early:
255-`blacksmith testbox warmup ci-check-testbox.yml` → save the ID
282+`blacksmith testbox warmup ci-check-testbox.yml --idle-timeout 90` → save the ID.
283+ Use `--idle-timeout 240`, `720`, or `1440` only when the task duration
284+ justifies it.
2562853. Write code while the testbox boots in the background.
2572864. Run the remote command when needed:
258287`blacksmith testbox run --id <ID> "npm test"`
259-5. If tests fail, fix code and re-run against the same warm box.
288+5. If tests fail, fix code and re-run against the same warm box. Reuse this
289+ same `tbx_...` for every run/download in the task unless it expires, the
290+ workflow/ref/env must change, or the user asks for a fresh box.
2602916. If you changed dependency manifests (package.json, etc.), prepend
261292 the install command: `blacksmith testbox run --id <ID> "npm install && npm test"`
2622937. If you need artifacts (coverage reports, build outputs, etc.), download them:
263294`blacksmith testbox download --id <ID> coverage/ ./coverage/`
2642958. Once green, commit and push.
296+9. If you used a long timeout or created probe boxes, clean up with
297+`blacksmith testbox list` and `blacksmith testbox stop --id <ID>`. Stop only
298+ boxes from the current task unless the user asks you to clean up other active
299+ boxes.
265300266301## OpenClaw full test suite
267302@@ -334,10 +369,24 @@ timeout is reached). Default timeout is 5m; use `--wait-timeout` for longer
334369Testboxes automatically shut down after being idle (default: 30 minutes).
335370If you need a longer session, increase the timeout at warmup time:
336371337-blacksmith testbox warmup ci-check-testbox.yml --idle-timeout 60
372+blacksmith testbox warmup ci-check-testbox.yml --idle-timeout 90
373+374+For OpenClaw maintainer work, use coarse timeout bins instead of probing many
375+small values:
376+377+- `90` minutes: default long-ish task
378+- `240` minutes: multi-hour task
379+- `720` minutes: all-day task
380+- `1440` minutes: overnight task; max without explicit user intent
381+382+Because the service currently accepts much larger values, cleanup is part of
383+the workflow, not a nice-to-have:
384+385+blacksmith testbox list
386+blacksmith testbox stop --id <ID>
338387339388## With options
340389341390blacksmith testbox warmup ci-check-testbox.yml --ref main
342-blacksmith testbox warmup ci-check-testbox.yml --idle-timeout 60
391+blacksmith testbox warmup ci-check-testbox.yml --idle-timeout 240
343392blacksmith testbox run --id <ID> "go test ./..."
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。