Skip to content

Commit 5524092

Browse files
steipeteampagent
andauthored
fix: avoid nesting dedicated Linux workers (#124636)
* fix: avoid nesting dedicated Linux workers * fix: preserve worker routing prerequisites --------- Co-authored-by: Amp <[email protected]>
1 parent eeffa53 commit 5524092

14 files changed

Lines changed: 217 additions & 76 deletions

File tree

‎.agents/skills/auto-qa/SKILL.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ Read [references/live-proof-routing.md](references/live-proof-routing.md) before
6464
2. Independently reproduce the actual current-main user path. Map the entry point, canonical owner, callers, callees, sibling implementations, state lifecycle, existing regressions, shipped contracts, and relevant direct upstream source. Identify why the current design fails before proposing a repair.
6565
3. Refactor the canonical owner in an isolated worktree. Repair all affected sibling paths in the same coherent change, simplify or remove the defective abstraction, and carry authoritative facts through the existing lifecycle. Prefer the cleanest appropriately sized root-cause solution over a minimal diff; reject a guard, special case, extra cache, fallback, compatibility shim, or narrowly passing test that leaves the architectural defect behind.
6666
4. Preserve public configuration, plugin ownership, gateway protocol, migrations, provider contracts, persistent state, and external dependencies. When a correct root-cause repair would change a sensitive contract or requires a product decision, prepare it for operator review; do not disguise that risk as a small autonomous fix.
67-
5. Add authentic regression coverage for the original reproduction, affected siblings, lifecycle cleanup, and unchanged legitimate behavior. Run appropriately scoped proof on the exact candidate head. Route Docker, real providers, packaging, full checks, typechecking, broad suites, and browser work through the existing remote workflow; inspect actual exit status, nonzero scenario counts, and artifacts.
67+
5. Add authentic regression coverage for the original reproduction, affected siblings, lifecycle cleanup, and unchanged legitimate behavior. Run appropriately scoped proof on the exact candidate head. Follow `$openclaw-testing` host routing: use the current dedicated Linux worker for capable trusted-source Docker, packaging, full checks, typechecking, broad suites, provider, and browser work; use the existing remote workflow when another capability or boundary is required. Inspect actual exit status, nonzero scenario counts, and artifacts.
6868
6. Run a fresh `$autoreview` on the complete final refactor. Require the reviewer to compare owner boundaries and sibling implementations, confirm this is the best clean root-cause solution, and reject quick-fix residue even when tests pass. Resolve actionable findings; rerun review after any production, test, or head change. Personally read the latest ClawSweeper review, satisfy each applicable rank-up move with real evidence, and update the existing PR body before landing.
6969
7. Check existing open PRs, current author counts, and the actual repository automation before publishing. Read both the current labeler and response policy; verify the authenticated author association, repository permission, account type, automation branch prefix, and actual override label. Apply only exemptions proved by that current policy, including eligible owners, maintainers, collaborators, bots or apps, approved automation branches, and explicit overrides. Never infer capacity from a truncated list or assume that one privileged role represents every exemption. Reuse and repair an existing candidate PR for the same cause. When a real cap applies, hold reviewed worktrees and finish or land existing verified work first.
7070
8. Create a focused PR with the repository's actual template, canonical cause, user impact, frozen head, completed proof, and risk. Use only the current repo-native `scripts/pr` review, artifact, prepare, and merge workflow for authorized main landing.

‎.agents/skills/auto-qa/references/live-proof-routing.md‎

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,15 @@ Read the app's scoped owner guide. Record whether macOS app signing, physical
5151
iOS/Android devices, simulators, Android emulators, or hosted runners were
5252
actually available and exercised. Source inspection is not runtime proof.
5353

54-
## Remote execution
54+
## Execution host
5555

56-
Follow `.agents/skills/crabbox/SKILL.md` for heavy trusted-source suites,
57-
packaging, Docker, browser, and live provider proof. Acquire a trusted lease
58-
only when needed and execute **one command at a time per lease**. Sync and
59-
verify the exact candidate SHA before running. A 780-second timeout bounds an
60-
individual subagent scenario after its setup completes.
56+
Follow `.agents/skills/openclaw-testing/SKILL.md` for the current-host gate.
57+
Run capable trusted-source Linux suites, packaging, Docker, browser, and live
58+
provider proof directly on a dedicated Linux worker. When another capability
59+
or boundary requires Crabbox, acquire a trusted lease only when needed and
60+
execute **one command at a time per lease**. Sync and verify the exact candidate
61+
SHA before running. A 780-second timeout bounds an individual subagent scenario
62+
after its setup completes.
6163

6264
If an orchestrator process or session disappears, inspect the original remote
6365
job, recorded command, and authoritative exit status before retrying. A missing

‎.agents/skills/control-ui-e2e/SKILL.md‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,10 @@ node scripts/run-vitest.mjs run --config test/vitest/vitest.ui-e2e.config.ts --c
2828
pnpm test:ui:e2e
2929
```
3030

31-
If dependencies are missing in a Codex worktree, install once with `pnpm install`; for broad GUI proof or dependency-heavy checks, use Testbox/Crabbox instead of running a wide local pnpm lane.
31+
Do not install dependencies into a linked/sparse worktree. For broad GUI proof
32+
or dependency-heavy checks, use a prepared normal checkout on the current
33+
dedicated Linux worker when it has browser support; otherwise use
34+
Testbox/Crabbox instead of running a wide lane on a workstation.
3235

3336
## Visual Proof Default
3437

‎.agents/skills/crabbox/SKILL.md‎

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,28 +18,49 @@ Backends:
1818
Always report provider, id, run URL, command, result. Never call Testbox “AWS
1919
Crabbox.”
2020

21+
## Host Gate
22+
23+
Do not acquire a remote Linux lease before classifying the current execution
24+
host. A dedicated Linux worker is isolated/disposable, headless, assigned to the
25+
current task, and safe for trusted repository code. Run suitable trusted Linux
26+
tests, builds, Docker/package work, and heavy checks directly there; nesting
27+
Crabbox only creates another machine with the same role.
28+
29+
Use generic properties only: Linux, no interactive desktop/user session, and a
30+
virtualized/containerized boundary. For equivalent bare-metal or hidden
31+
virtualization, `AGENT_HOST_ROLE=worker` is the explicit signal;
32+
`AGENT_HOST_ROLE=workstation` opts out. Never match a session vendor, agent
33+
runtime, hostname brand, or provider-specific environment variable. Ambiguity
34+
means workstation. Explicit remote requests still win.
35+
36+
Use Crabbox from a dedicated worker only when proof needs a distinct capability
37+
or boundary: another OS/device, desktop/browser support the worker lacks,
38+
clean-room handling of untrusted source, credentials absent from the worker,
39+
release/CI parity, or a user-requested remote backend.
40+
2141
## Route First
2242

23-
Source trust before test size.
43+
Source trust, then current host, then test size/capability.
2444

2545
- Trusted + one/few focused tests + ready deps: local.
26-
- Trusted + heavy proof: Blacksmith Testbox.
46+
- Trusted + dedicated Linux worker + suitable Linux proof: current worker.
47+
- Trusted + workstation + heavy proof: Blacksmith Testbox.
2748
- Untrusted contributor/fork: secretless fork CI or sanitized direct AWS.
2849
- Never untrusted code on credential-hydrated Testbox.
2950
- Never run untrusted repo wrapper/config locally.
3051
- No speculative warmup. Acquire when first heavy command ready. Reuse id. Stop
31-
before handoff. Local proof fanning out/expensive: stop local, go remote.
52+
before handoff. Workstation proof fanning out/expensive: stop local, go remote.
3253
- Remote backend unavailable (broker/DNS/network/lease): trusted-source proof
3354
falls back to local — including heavy suites/gates — instead of blocking.
3455
Note fallback + reason in the proof summary. Untrusted source never falls
3556
back to local.
3657

3758
Need direct AWS semantics? Pass `--provider aws`. Need normal trusted OpenClaw
38-
heavy proof? Pass `--provider blacksmith-testbox`.
59+
remote proof from a workstation? Pass `--provider blacksmith-testbox`.
3960

4061
## Preflight
4162

42-
Run from repo root.
63+
Run from repo root only after the host gate says remote proof is needed.
4364

4465
```sh
4566
command -v crabbox

‎.agents/skills/openclaw-debugging/SKILL.md‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,8 @@ work, copy the DB into a dev state dir first.
150150
- Worker/dist/lazy import/package surface: targeted tests plus `pnpm build`.
151151
- Live provider/model behavior: same provider/model with debug flags and a real
152152
key if available.
153-
- Docker/package/Linux/CI-parity: `$crabbox`.
153+
- Docker/package/Linux/CI-parity: current dedicated Linux worker when capable;
154+
otherwise `$crabbox`.
154155
- CI failure: exact SHA, relevant job only, logs only after failure/completion.
155156

156157
## Output Habit

‎.agents/skills/openclaw-pr-maintainer/SKILL.md‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -332,8 +332,9 @@ gh search issues --repo openclaw/openclaw --match title,body --limit 50 \
332332
Tests that source `scripts/pr-lib/*` directly must provide the same command
333333
surface instead of weakening the production wrapper for a minimal test image.
334334
- Classify source trust before executing code-changing or landing proof; acquire
335-
the safe backend lazily through `$crabbox` at the first heavy proof, never
336-
pre-warm it at task start. Trusted maintainer code defaults to Blacksmith Testbox;
335+
a safe remote backend lazily through `$crabbox` only when the current host
336+
gate requires one; never pre-warm it at task start. Trusted maintainer code
337+
runs suitable proof on a dedicated Linux worker and otherwise defaults to Blacksmith Testbox;
337338
contributor/fork code stays untrusted unless a maintainer explicitly approves
338339
credentialed execution after review; it uses secretless fork CI or
339340
sanitized direct AWS Crabbox with `CRABBOX_ENV_ALLOW=CI`,

‎.agents/skills/openclaw-repair-sweep/SKILL.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,8 @@ proof choice, `$autoreview` pre-publish review, `$crabbox` heavy/remote proof.
8484
recorded checkpoint.
8585
- Classify source trust before execution. Untrusted contributor code, tests,
8686
or wrappers never run locally or on a credential-hydrated host; use the
87-
sanitized remote-proof path. Route heavy trusted proof to the selected
88-
remote box.
87+
sanitized remote-proof path. Run capable heavy trusted proof on the current
88+
dedicated Linux worker; otherwise use the selected remote box.
8989
- Before replacing a failed or interrupted worker, preserve its claimed items,
9090
patches, checkout ownership, and evidence; hand them to exactly one
9191
replacement without duplicating or discarding unfinished work.

‎.agents/skills/openclaw-test-performance/SKILL.md‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,9 @@ barrels, package-boundary tests, or extension suites.
9393
- runtime capture should be quiet and config-tolerant.
9494
- command output should include wall time, exit code, and peak RSS when
9595
available.
96-
4. For broad or package-heavy plugin proof, use Crabbox-backed Blacksmith
97-
Testbox by default on maintainer machines:
96+
4. For broad or package-heavy plugin proof, use the current dedicated Linux
97+
worker when available. On a maintainer workstation, use Crabbox-backed
98+
Blacksmith Testbox:
9899
- `pnpm crabbox:run -- --provider blacksmith-testbox --timing-json -- OPENCLAW_TESTBOX=1 pnpm test:extensions:batch <ids>`
99100
- add `--keep`/`--id <id-or-slug>` only when several commands must share one
100101
warmed box; stop it with `pnpm crabbox:stop -- <id-or-slug>`.

‎.agents/skills/openclaw-testing/SKILL.md‎

Lines changed: 42 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -18,20 +18,31 @@ or validating a change without wasting hours.
1818

1919
Prove the touched surface first. Do not reflexively run the whole suite.
2020

21-
Route by source trust first, then proof size. Only trusted source may run
22-
locally; never execute untrusted repository tooling locally, regardless of
23-
proof size. Run one/few focused tests and cheap static checks locally when the
24-
existing dependency install is ready. Use a
25-
remote backend for larger suites, changed gates with typecheck/lint fan-out,
26-
builds, Docker, packaging, E2E, live proof, and cross-platform work. Trusted
27-
maintainer heavy proof defaults to Blacksmith Testbox. Untrusted contributor
28-
or fork code must use secretless fork CI or sanitized direct AWS Crabbox;
29-
never sync or run it on the credential-hydrated Blacksmith workflow.
30-
31-
Do not pre-warm for anticipated work. Acquire the backend lazily when the
32-
first heavy command is ready to run, save its id, reuse it for later heavy
33-
commands, and stop it before handoff. A single late heavy command can remain a
34-
one-shot.
21+
Route by source trust first, execution host second, then proof size and required
22+
capabilities. Only trusted source may run on the current host; never execute
23+
untrusted repository tooling there, regardless of proof size. Run focused tests
24+
and cheap static checks wherever dependencies are ready. If the current host is
25+
a dedicated Linux worker, run suitable heavy Linux proof there too: larger
26+
suites, changed gates, builds, Docker, packaging, E2E/live work, and
27+
typecheck/lint fan-out. Do not nest a remote Linux box only to replace an
28+
existing dedicated Linux worker. On a developer workstation, or when proof
29+
requires another OS, device, browser/desktop, trust boundary, credentials, or
30+
prepared release environment, use the matching remote backend. Trusted
31+
maintainer remote proof defaults to Blacksmith Testbox. Untrusted contributor
32+
or fork code must use secretless fork CI or sanitized direct AWS Crabbox; never
33+
sync or run it on the credential-hydrated Blacksmith workflow.
34+
35+
Detect host role from generic properties, never session-provider or agent-product
36+
names. A dedicated worker is Linux, isolated/disposable, headless, and assigned
37+
to the current task. `check:changed` auto-detects a headless noninteractive
38+
virtualized/containerized Linux host. Set `AGENT_HOST_ROLE=worker` for an
39+
equivalent bare-metal or otherwise undetectable host, or
40+
`AGENT_HOST_ROLE=workstation` to opt out. Treat ambiguity as a workstation.
41+
42+
Do not pre-warm for anticipated work. When a remote backend is actually needed,
43+
acquire it lazily when the first remote command is ready, save its id, reuse it
44+
for later remote commands, and stop it before handoff. A single late remote
45+
command can remain a one-shot.
3546

3647
For untrusted heavy proof, switch to a clean trusted `main` checkout and lazily
3748
warm direct AWS with an installed trusted Crabbox binary. Do not execute the
@@ -95,13 +106,16 @@ sync the current checkout on every run, and stop it before handoff.
95106
1. Inspect the diff and classify the touched surface:
96107
- trusted source, one/few focused tests with ready local dependencies:
97108
`node scripts/run-vitest.mjs <path-or-filter>`
98-
- if focused proof fans out, becomes expensive, or lacks ready dependencies:
99-
acquire the safe remote backend selected by source trust
109+
- on a dedicated Linux worker, install missing dependencies in a normal
110+
checkout and run suitable heavy Linux proof directly
111+
- on a workstation, if focused proof fans out, becomes expensive, or lacks
112+
ready dependencies: acquire the safe remote backend selected by source trust
100113
- changed gates, builds, typechecks, lint fan-out, Docker, package, E2E, or
101-
live work: run it remotely; these are never routine laptop work
114+
live work: run on the dedicated worker when it has the required capability;
115+
otherwise use the matching remote workflow
102116
- `check:changed` classifies first; docs-only, no-change, and small metadata
103-
plans stay local when dependencies are ready, while heavy or dependency-
104-
missing plans delegate remotely
117+
plans stay on the current host; heavy or dependency-missing plans stay on a
118+
dedicated worker but delegate from a workstation
105119
- direct AWS Crabbox proof: pass `--provider aws`; untrusted code also
106120
requires the sanitized invocation above
107121
- workflow-only: `git diff --check`, workflow syntax/lint (`actionlint` when available)
@@ -114,22 +128,24 @@ sync the current checkout on every run, and stop it before handoff.
114128
## Guardrails
115129

116130
- Do not kill unrelated processes or tests. If something is running elsewhere, treat it as owned by the user or another agent.
117-
- Keep trusted-source local proof bounded to one/few focused tests and cheap
118-
static checks with ready dependencies. Untrusted repository tooling never
119-
runs locally. Full suites and computationally intensive commands run remotely.
131+
- Keep trusted-source workstation proof bounded to one/few focused tests and
132+
cheap static checks with ready dependencies. A dedicated worker may run full
133+
suites and computationally intensive commands directly. Untrusted repository
134+
tooling never runs on either host class.
120135
- Prefer GitHub Actions for release/Docker proof when the workflow already has the prepared image and secrets.
121136
- Use standard Git commands when committing; stage only your files.
122-
- If dependencies are missing on the selected remote box, run `pnpm install` there, retry
123-
once, then report the first actionable error. Do not reconcile or reinstall a
124-
local Codex worktree merely to run validation.
137+
- If dependencies are missing on the selected execution host, run `pnpm install`
138+
there when it is a normal checkout, retry once, then report the first
139+
actionable error. Do not reconcile or reinstall a linked/sparse worktree
140+
merely to run validation.
125141
- In a Codex worktree or linked/sparse checkout, do not run direct local
126142
`pnpm test*`, `pnpm check*`, or `pnpm crabbox:run`. Use
127143
`node scripts/crabbox-wrapper.mjs` for remote proof and
128144
`node scripts/check-changed.mjs` for classify-first changed checks. Use
129145
`node scripts/run-vitest.mjs` for bounded focused local proof when the
130146
dependency install is ready. Use `git commit --no-verify` only after the
131147
relevant proof is already clean.
132-
- For remote proof, use the Crabbox wrapper first, but name the actual backend.
148+
- When remote proof is required, use the Crabbox wrapper first, but name the actual backend.
133149
Direct AWS Crabbox uses `provider=aws` and `cbx_...` ids. Delegated
134150
Blacksmith Testbox through Crabbox uses `provider=blacksmith-testbox`,
135151
`syncDelegated=true`, and `tbx_...` ids. Both satisfy "remote proof" when the

‎.agents/skills/release-openclaw-plugin-testing/SKILL.md‎

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,18 +36,22 @@ pnpm changed:lanes --json
3636

3737
In Codex worktrees under `.codex/worktrees`, `node_modules` must be a symlink to
3838
the main OpenClaw checkout. Do not run `pnpm install` there. For broad or
39-
package-heavy proof, use Blacksmith Testbox or GitHub Actions.
39+
package-heavy proof, use a prepared normal checkout on the current dedicated
40+
Linux worker, Blacksmith Testbox, or GitHub Actions according to the required
41+
artifact and capability boundary.
4042

4143
## Runner Choice
4244

4345
Prefer this order:
4446

4547
1. **GitHub Package Acceptance** for installable-package product proof.
46-
2. **`ci-build-artifacts-testbox.yml` Testbox** when Docker/package lanes need
48+
2. **Current dedicated Linux worker** for trusted source/package/Docker proof
49+
when it has the required dependencies and capabilities.
50+
3. **`ci-build-artifacts-testbox.yml` Testbox** when Docker/package lanes need
4751
seeded `dist`, `dist-runtime`, and package caches.
48-
3. **`ci-check-testbox.yml` Testbox** for source checks, targeted Vitest,
52+
4. **`ci-check-testbox.yml` Testbox** for source checks, targeted Vitest,
4953
package-boundary checks, or focused Docker lanes.
50-
4. **Local targeted commands only** for small format/static/unit probes.
54+
5. **Workstation targeted commands only** for small format/static/unit probes.
5155

5256
Avoid long package Docker runs from a stale sparse worktree. If Testbox sync
5357
reports hundreds of changed files or starts deleting package inputs, stop and

0 commit comments

Comments
 (0)