Skip to content

fix: avoid nesting dedicated Linux workers - #124636

Merged
steipete merged 2 commits into
mainfrom
fix/dedicated-linux-worker-routing
Aug 16, 2026
Merged

steipete merged 2 commits into
mainfrom
fix/dedicated-linux-worker-routing

Conversation

@steipete

@steipete steipete commented Aug 16, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Automated changed-file gates running on an already isolated, disposable Linux worker delegated trusted heavy checks to another remote Linux worker. That duplicated the execution environment, added startup latency, and coupled routing assumptions to an interactive-workstation model that does not hold across automation systems.

Why This Change Was Made

The changed-check owner now classifies a dedicated worker from generic host properties: Linux, headless, noninteractive, and virtualized/containerized. AGENT_HOST_ROLE=worker covers equivalent hosts that cannot be detected, while AGENT_HOST_ROLE=workstation opts out. Explicit remote requests still win, and proof requiring another OS, device, trust boundary, credentials, desktop/browser capability, or release environment still routes remotely.

Direct worker execution requires successful diff classification and a ready dependency install. Missing classification or dependencies preserve the existing hydrated remote fallback.

The repository policy and affected testing/QA skills now use the same source-trust → execution-host → capability decision order. Detection does not depend on a session vendor, agent product, hostname, or provider-specific environment variable.

User Impact

Trusted tests, builds, Docker/package checks, and typecheck/lint fan-out can run directly on an existing capable Linux worker instead of provisioning a redundant one. Developer workstations and capability-specific or clean-room workflows retain their existing remote routing.

Evidence

  • Exact-head focused regression: npx -y node@24 /usr/local/lib/node_modules/pnpm/bin/pnpm.cjs test test/scripts/changed-lanes.test.ts — 152 tests passed.
  • Full affected changed gate passed on the corrected tree, covering conflict markers, docs/attribution checks, script and test-root typechecks, lint, Docker E2E boundaries, and raw HTTP/2 guard.
  • Exact-head git diff origin/main...HEAD --check passed.
  • Current-host routing probe returned runs-current-worker.
  • ClawSweeper's missing-classification and missing-dependency findings were resolved with focused regressions.
  • Fresh post-fix autoreview reported no findings and patch is correct (confidence 0.98).
  • Required exact-head CI passed in run 31954788207.

LOC: tooling +37/-0 (net +37), tests +60/-6, policy/docs +120/-70. The tooling growth owns the generic host classification and explicit override contract; no product/session-specific detection paths were added.

@clawsweeper

clawsweeper Bot commented Aug 16, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@openclaw-barnacle openclaw-barnacle Bot added scripts Repository scripts size: M maintainer Maintainer-authored PR labels Aug 16, 2026
@steipete
steipete marked this pull request as ready for review August 16, 2026 14:18
@steipete steipete self-assigned this Aug 16, 2026
@clawsweeper clawsweeper Bot added merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. P2 Normal backlog priority with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Aug 16, 2026
@clawsweeper

clawsweeper Bot commented Aug 16, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge. Reviewed August 16, 2026, 11:20 AM ET / 15:20 UTC.

ClawSweeper review

What this changes

Updates changed-file validation to run suitable trusted checks on detected dedicated Linux workers, adds AGENT_HOST_ROLE overrides, and aligns routing guidance and regression tests.

Merge readiness

⛔ Blocked by patch quality or review findings - 5 items remain

Keep open: the prior P1 remains on the unchanged head. A ready dedicated worker bypasses the missing-ref prerequisite for release-metadata validation and can run it in a sparse checkout instead of delegating to the hydrated backend.

Priority: P2
Reviewed head: 7dad948cc1fc5cb36bee94f98bfc2287305e20d3

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) The routing change has focused evidence, but a previously identified P1 correctness defect remains on the exact reviewed head.
Proof confidence 🌊 off-meta tidepool Not applicable: This is maintainer-authored work, so the external-contributor proof gate does not apply; the reported exact-head test run and routing probe remain supplemental evidence.
Patch quality 🦪 silver shellfish (2/6) 1 actionable review finding remain.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This is maintainer-authored work, so the external-contributor proof gate does not apply; the reported exact-head test run and routing probe remain supplemental evidence.
Evidence reviewed 5 items Unfixed prerequisite ordering: The PR head checks the dedicated-worker fast path before the existing release-metadata missing-ref guard. With ready dependencies, the fast path returns false and lines 286-289 are never reached.
Caller supplies the skipped fact: The command entry point computes and passes diffRefsReady: false for release-metadata plans when the requested base/head cannot be resolved.
Regression gap: The added dedicated-worker test covers a normal source lane and dependency readiness, but does not combine a release-metadata lane with diffRefsReady: false.
Findings 1 actionable finding [P1] Check diff refs before the dedicated-worker bypass
Security None None.

How this fits together

Changed-file validation classifies modified paths into check lanes, then chooses whether to run the resulting checks locally or through a hydrated remote backend. This routing feeds maintainer automation and determines whether checkout-dependent validation has the refs and dependencies it needs.

flowchart LR
  A[Changed paths] --> B[Classify check lanes]
  B --> C[Check required refs and dependencies]
  C --> D[Classify execution host]
  D --> E{Run location}
  E --> F[Dedicated Linux worker]
  E --> G[Hydrated remote backend]
Loading

Before merge

  • Check diff refs before the dedicated-worker bypass (P1) - A prepared dedicated worker returns at this new fast path before the existing release-metadata guard below can inspect diffRefsReady. When a sparse checkout runs a release-metadata plan with unavailable base/head refs, it therefore runs locally instead of using the hydrated backend. Move that prerequisite above this branch and cover the combined case; this is the still-unfixed P1 from the prior review.
  • Resolve merge risk (P1) - Merging as written can make a sparse but prepared dedicated worker run release-metadata validation without the requested diff refs, where the existing hydrated remote route is required.
  • Complete next step (P2) - A narrow, source-proven ordering repair and one focused regression can resolve the remaining blocker without changing the routing direction.
  • Improve patch quality - Move the release-metadata missing-ref guard before the dedicated-worker branch.
  • Improve patch quality - Add and run the focused ready-worker plus missing-ref regression.

Findings

  • [P1] Check diff refs before the dedicated-worker bypass — scripts/check-changed.mts:283-284
Agent review details

Security

None.

PR surface

Tests +54, Docs +50, Other +37. Total +141 across 14 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 60 6 +54
Docs 12 120 70 +50
Config 0 0 0 0
Generated 0 0 0 0
Other 1 37 0 +37
Total 14 217 76 +141

Review metrics

Metric Value Why it matters
Production versus test delta tooling +37/-0; tests +60/-6; policy/docs +120/-70 The new host-routing decision and one environment override add runtime automation behavior, while focused tests cover normal worker routing but not the missing-ref combination.
Execution-host override 1 added environment variable (AGENT_HOST_ROLE, two values) It changes how existing automation selects direct versus remote execution and should retain a clear, tested precedence order.

Merge-risk options

Maintainer options:

  1. Preserve release-metadata delegation (recommended)
    Move the missing-ref prerequisite ahead of the worker fast path and add the ready-worker/missing-ref regression before merge.

Technical review

Best possible solution:

Keep direct execution for capable workers, but evaluate missing release-metadata refs before the worker bypass and lock that ordering with a focused regression.

Do we have a high-confidence way to reproduce the issue?

Yes—source provides a high-confidence path: use a prepared dedicated Linux worker, a release-metadata-only path such as CHANGELOG.md, and unresolved diff refs. This read-only review did not execute the command.

Is this the best way to solve the issue?

No—the worker-routing approach is viable, but the existing missing-ref prerequisite must run before the new fast path.

Full review comments:

  • [P1] Check diff refs before the dedicated-worker bypass — scripts/check-changed.mts:283-284
    A prepared dedicated worker returns at this new fast path before the existing release-metadata guard below can inspect diffRefsReady. When a sparse checkout runs a release-metadata plan with unavailable base/head refs, it therefore runs locally instead of using the hydrated backend. Move that prerequisite above this branch and cover the combined case; this is the still-unfixed P1 from the prior review.
    Confidence: 0.99

Overall correctness: patch is incorrect
Overall confidence: 0.99

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 5a0fe2232b46.

Labels

Label changes:

  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🌊 off-meta tidepool and patch quality is 🦪 silver shellfish.
  • remove rating: 🧂 unranked krab: Current PR rating is rating: 🦪 silver shellfish, so this older rating label is no longer current.

Label justifications:

  • P2: The remaining defect affects changed-check automation on a bounded sparse-worker/release-metadata path.
  • merge-risk: 🚨 automation: This PR changes where automated changed-file checks run and currently bypasses the remote prerequisite needed for missing diff refs.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🌊 off-meta tidepool and patch quality is 🦪 silver shellfish.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Not applicable: This is maintainer-authored work, so the external-contributor proof gate does not apply; the reported exact-head test run and routing probe remain supplemental evidence.

Evidence

Acceptance criteria:

  • [P1] npx -y node@24 /usr/local/lib/node_modules/pnpm/bin/pnpm.cjs test test/scripts/changed-lanes.test.ts.
  • [P1] Run the focused ready-worker/release-metadata/missing-ref routing assertion on the exact PR head.
  • [P1] git diff origin/main...HEAD --check.

What I checked:

  • Unfixed prerequisite ordering: The PR head checks the dedicated-worker fast path before the existing release-metadata missing-ref guard. With ready dependencies, the fast path returns false and lines 286-289 are never reached. (scripts/check-changed.mts:283, 7dad948cc1fc)
  • Caller supplies the skipped fact: The command entry point computes and passes diffRefsReady: false for release-metadata plans when the requested base/head cannot be resolved. (scripts/check-changed.mts:1325, 7dad948cc1fc)
  • Regression gap: The added dedicated-worker test covers a normal source lane and dependency readiness, but does not combine a release-metadata lane with diffRefsReady: false. (test/scripts/changed-lanes.test.ts:1244, 7dad948cc1fc)
  • Current-main baseline and provenance: Current main has the missing-ref guard ahead of normal delegation; blame attributes that routing boundary to commit 243f51d. The proposed worker bypass is not on current main. (scripts/check-changed.mts:251, 243f51d314d1)
  • Autoreview availability: The required autoreview helper could not start because TruffleHog is unavailable; no reviewer result was claimed from that attempt. (2bd42f60f791)

Likely related people:

  • Peter Steinberger: Git blame attributes the current changed-check routing and release-metadata prerequisite to this author; the PR changes that same decision point. (role: current routing-boundary author; confidence: high; commits: 243f51d314d1; files: scripts/check-changed.mts)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (2 earlier review cycles)
  • reviewed 2026-08-16T14:56:39.273Z sha 2bd42f6 :: found issues before merge. :: [P1] Delegate when diff classification cannot run | [P1] Keep unprepared workers on the remote path
  • reviewed 2026-08-16T15:14:15.423Z sha 7dad948 :: needs changes before merge. :: [P1] Check release-metadata prerequisites before worker bypass

Copy link
Copy Markdown
Contributor Author

Land-ready after review fixes on 7dad948cc1fc5cb36bee94f98bfc2287305e20d3.

  • Root cause/owner: shouldDelegateChangedCheckToCrabbox assumed every non-CI heavy plan originated on a workstation, so an existing dedicated Linux worker provisioned another worker.
  • Canonical fix: generic Linux/headless/noninteractive/virtualized detection at that owner, with AGENT_HOST_ROLE=worker|workstation overrides. Direct execution requires a classified diff and ready dependencies; explicit remote, trust, OS/device, credential, browser/desktop, and release boundaries remain remote.
  • ClawSweeper rank-up moves: all applied. Missing-result delegation now precedes host detection; unprepared workers still delegate; both paths have regressions.
  • Exact-head focused proof: npx -y node@24 /usr/local/lib/node_modules/pnpm/bin/pnpm.cjs test test/scripts/changed-lanes.test.ts — 152/152 passed.
  • Full affected proof: npx -y node@24 /usr/local/lib/node_modules/pnpm/bin/pnpm.cjs check:changed -- <all 14 PR paths> — passed format, script/test-root typechecks, lint, Docker E2E boundaries, and raw HTTP/2 guard.
  • Fresh post-fix autoreview: no findings; patch is correct (confidence 0.98).
  • Required exact-head CI: run 31954788207 — green.
  • Native prepare: OPENCLAW_TESTBOX=1 scripts/pr prepare-run 124636 — hosted_exact_or_recent_parent; no remote lease was acquired.

LOC: tooling +37/-0, tests +60/-6, policy/docs +120/-70. Removed paths: none; the existing remote fallback remains the canonical path when prerequisites or capabilities are unavailable. Known proof gap: hosts without detectable virtualization need the documented generic override; ambiguity safely remains workstation routing.

@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. labels Aug 16, 2026
@steipete
steipete merged commit 5524092 into main Aug 16, 2026
74 checks passed

Copy link
Copy Markdown
Contributor Author

Merged via squash.

@steipete
steipete deleted the fix/dedicated-linux-worker-routing branch August 16, 2026 15:25
steipete added a commit that referenced this pull request Aug 16, 2026
The doctor migration for the retired key kept its "Preserved for remediation"
change text and describe; both now state plain removal, with the retired
tests updated. peekStoredDeviceIdentityId lost its only production consumer
with the deleted banner loader and is removed with its test mock. Also fixes
the unrelated no-unnecessary-boolean-literal-compare lint break that #124636
landed on main in scripts/check-changed.mts (truthiness is equivalent for the
boolean-or-undefined TTY probe).
steipete added a commit that referenced this pull request Aug 16, 2026
…#124667)

* refactor(gateway): delete the retired Control UI device-auth migration window

The one-time remediation window for the retired
gateway.controlUi.dangerouslyDisableDeviceAuth break-glass threaded a pending
state machine through the connect pipeline, startup bootstrap, lifecycle,
request context, device management, security audit, the hello frame, and a
Control UI banner flow — steady-state runtime carrying a retired-shape shim
the architecture reserves for doctor. The window is closed: the retired key
is now fully inert, doctor still detects and removes it, and a browser that
never completed the migration pairs through the normal device flow (one
approval, no data loss).

Deleted with it: the config-machine-state import of the legacy flag, the
hello deviceAuthMigration field (optional; clients validate envelopes only,
so older gateways emitting it stay compatible), the migration-bound device
management authz states, the requireNoPairingCapableOperator approval mode,
the effective-operator pairing event emitter whose only subscriber was the
migration completion, and the Control UI banner, loader, overlay wiring,
i18n strings, and e2e scenario support. Swift and Kotlin protocol models
regenerated.

Live-verified on an isolated gateway with the retired key present in config:
clean boot with no migration warning, silent CLI pairing and silent local
scope widening unaffected, and doctor reporting the key as retired-and-inert.

Net -1111 production LOC.

* fix(ci): finish migration-window cleanup surfaced by the gates

The doctor migration for the retired key kept its "Preserved for remediation"
change text and describe; both now state plain removal, with the retired
tests updated. peekStoredDeviceIdentityId lost its only production consumer
with the deleted banner loader and is removed with its test mock. Also fixes
the unrelated no-unnecessary-boolean-literal-compare lint break that #124636
landed on main in scripts/check-changed.mts (truthiness is equivalent for the
boolean-or-undefined TTY probe).

* fix(ui): drop the retired-key device-auth reader from the security summary

Review findings on the migration-window removal: the Control UI security
summary still derived its "Device auth" row from the retired
dangerouslyDisableDeviceAuth key, rendering device auth as disabled on
configurations that merely retain the inert key. Device auth is now
unconditionally enforced, so the row and its derivation are removed rather
than pinned to a constant. The build-admission test also tracks and removes
its temporary device-identity databases after each run.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 17, 2026
* fix: avoid nesting dedicated Linux workers

* fix: preserve worker routing prerequisites

---------

Co-authored-by: Amp <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 17, 2026
…openclaw#124667)

* refactor(gateway): delete the retired Control UI device-auth migration window

The one-time remediation window for the retired
gateway.controlUi.dangerouslyDisableDeviceAuth break-glass threaded a pending
state machine through the connect pipeline, startup bootstrap, lifecycle,
request context, device management, security audit, the hello frame, and a
Control UI banner flow — steady-state runtime carrying a retired-shape shim
the architecture reserves for doctor. The window is closed: the retired key
is now fully inert, doctor still detects and removes it, and a browser that
never completed the migration pairs through the normal device flow (one
approval, no data loss).

Deleted with it: the config-machine-state import of the legacy flag, the
hello deviceAuthMigration field (optional; clients validate envelopes only,
so older gateways emitting it stay compatible), the migration-bound device
management authz states, the requireNoPairingCapableOperator approval mode,
the effective-operator pairing event emitter whose only subscriber was the
migration completion, and the Control UI banner, loader, overlay wiring,
i18n strings, and e2e scenario support. Swift and Kotlin protocol models
regenerated.

Live-verified on an isolated gateway with the retired key present in config:
clean boot with no migration warning, silent CLI pairing and silent local
scope widening unaffected, and doctor reporting the key as retired-and-inert.

Net -1111 production LOC.

* fix(ci): finish migration-window cleanup surfaced by the gates

The doctor migration for the retired key kept its "Preserved for remediation"
change text and describe; both now state plain removal, with the retired
tests updated. peekStoredDeviceIdentityId lost its only production consumer
with the deleted banner loader and is removed with its test mock. Also fixes
the unrelated no-unnecessary-boolean-literal-compare lint break that openclaw#124636
landed on main in scripts/check-changed.mts (truthiness is equivalent for the
boolean-or-undefined TTY probe).

* fix(ui): drop the retired-key device-auth reader from the security summary

Review findings on the migration-window removal: the Control UI security
summary still derived its "Device auth" row from the retired
dangerouslyDisableDeviceAuth key, rendering device auth as disabled on
configurations that merely retain the inert key. Device auth is now
unconditionally enforced, so the row and its derivation are removed rather
than pinned to a constant. The build-admission test also tracks and removes
its temporary device-identity databases after each run.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. P2 Normal backlog priority with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. scripts Repository scripts size: M status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants