Repository navigation
fix: sync Cloud Worker workspaces from macOS gateways - #121027
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
Dependency GuardThis PR changes dependency-related files. Maintainers should confirm these changes are intentional. Changed files:
Maintainer follow-up:
|
Dependency graph changes notedThis PR includes dependency graph changes. The dependency guard is informational because the PR author is a repository admin or a member of
Security review is still recommended before merge when the dependency graph change is intentional. |
|
@clawsweeper re-review Please review exact head |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Codex review: found issues before merge. Reviewed August 9, 2026, 6:46 AM ET / 10:46 UTC. ClawSweeper reviewWhat this changesThe PR moves Cloud Worker rsync receivers into an attested worker-bundle entry so macOS Apple rsync can upload managed workspaces without malformed remote-shell commands. Regression provenancePossible regression — probable (reproduction; reviewed change; known regression link). No predecessor PR is attributed. Merge readinessKeep open: the bundled receiver fixes the Apple-rsync boundary for fresh workers, but it breaks workspace operations for active workers whose persisted bundle predates the new receiver entry. Priority: P1 Review scores
Verification
How this fits togetherCloud Worker dispatch uploads a Gateway workspace through rsync and SSH before an agent can start. The worker-side receiver selects a protected destination and runs the existing locked workspace-transfer lifecycle. flowchart LR
A[Gateway workspace] --> B[rsync over SSH]
B --> C[Bundled worker receiver]
C --> D[Validate mode context and nonce]
D --> E[Protected workspace destination]
E --> F[Locked workspace transfer]
F --> G[Cloud Worker session]
H[Persisted worker bundle receipt] --> C
Decision needed
Why: Both paths avoid breaking existing active workers, but they differ in upgrade interruption and whether the old shell-sensitive receiver remains supported. Before merge
Findings
Agent review detailsSecurityNone. PR surfaceSource +150, Tests +221, Config 0, Other +6. Total +377 across 24 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep one bundled receiver for new workers, but fence and rebootstrap pre-entry worker receipts before workspace operations, or retain a narrowly scoped legacy receiver for those receipts, with an upgrade/restart regression test. Do we have a high-confidence way to reproduce the issue? Yes, source-reproducible: pending-result recovery can synchronize a workspace through a persisted pre-entry bundle receipt, whose bundle lacks the new receiver file. A live upgrade/restart run is still needed to demonstrate the operator-visible failure. Is this the best way to solve the issue? No: the bundled receiver is the best fresh-worker fix, but the PR does not preserve the upgrade path for already bootstrapped workers. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 8b501c1c1343. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
Exact-head land-ready proofHead: Root cause and owner: Apple openrsync reparses Exact proof:
Hosted evidence:
Remote fallback: Blacksmith Testbox did not produce a lease because the delegated environment lacked the Rank-up disposition: the exact-head hosted checks are now green. For the lifecycle-proof decision, the maintainer accepts the review's option 2: the real Apple/GNU transport-boundary proof plus exact-head hosted CI is sufficient to merge, with the exact live AWS dispatch/reconcile/reclaim lifecycle required after deployment. Deploying this unmerged ancestry would strand the production pointer across the eventual squash merge, and this work order explicitly excludes deployment and the post-merge AWS run. Production LOC is net +75 (+69 runtime receiver ownership capability, +6 build/CI tooling); tests are net +302. The positive production delta is the named worker-bundle ownership boundary required for cross-rsync correctness. Remaining proof gap: no post-fix live AWS dispatch/reconcile/reclaim and no user acceptance are claimed in this PR. That lifecycle run remains a required post-deployment follow-up. No changelog change is included; release-note context is in the PR body. |
|
Merged via squash.
|
Correction: late ClawSweeper finding confirmed in a narrower failure stateMy earlier dismissal of the late P1 was too broad. The ordinary restart path does run
That gap can pass a pre-entry bundle hash to workspace recovery even though the corresponding bundle lacks the new receiver entry. The correct owner-boundary fix is to factor current-bundle admission verification and require it in both Focused follow-up: #121036 I am carrying that repair through a separate exact-head PR and native landing workflow. The earlier two focused tests only proved the successful reconciliation/lost-worker branches; they did not exercise bundle-preparation or provider-inspection failure followed by pending-result tunnel start. This correction supersedes the prior dismissal. |
* fix(cloud-workers): support Apple openrsync receivers * build: register worker receiver entry * fix(cloud-workers): narrow receiver invocation types * test(cloud-workers): resolve real rsync before wrapping
Closes #121026
Related: #120715, #120498
What Problem This Solves
Fixes an issue where operators dispatching Cloud Workers from a macOS Gateway with Apple
/usr/bin/rsyncwould have the initial managed-workspace upload fail before the first agent turn. AWS placement succeeded, but the upload receiver command was reparsed into invalid shell syntax, so the session never started.Why This Change Was Made
The worker bundle now owns a stable rsync receiver entry and the tunnel passes only closed, shell-safe mode/context/nonce words plus the attested bundle hash. The receiver uses the already-attested real target inside the existing worker runtime, preserving the canonical mutation lock, detached process-group ownership, reset/replay, SSH fallback/retry, and accepted-state settlement across Git pack and plain workspace uploads.
This is the complete owner-boundary repair: it does not detect rsync flavors, require Homebrew, add configuration or environment variables, add dependencies, introduce another transport or fallback, or change a public protocol surface. Inbound default-rsync downloads are unchanged.
User Impact
macOS Gateways using the system Apple rsync can dispatch, reconcile, and reclaim Cloud Workers the same way Linux/GNU rsync Gateways can. Operators do not need to install Homebrew rsync or configure a workaround.
Evidence
Observed before the fix on OpenClaw 2026.8.1 (
13e9bf23179089116286e619cd9a35d4616dff29) with Apple/usr/bin/rsyncopenrsync protocol 29 and Crabbox 0.39.0 AWS placement:Two valid dispatch attempts failed at the same initial sync boundary. Cleanup retired each exact environment/session/worktree, and the AWS lease listing showed zero OpenClaw-owned leases afterward.
Dependency contract proof:
shell -cexecution: https://github.com/openssh/openssh-portable/blob/e8dd756725e8800fcd0b3fd71ee6b4382d1e8fab/session.c#L1630-L1673Original exact-head proof for the implementation stack:
/usr/bin/rsyncboundary plus receiver/fallback/accepted/sync coverage: 34/34 passed.node scripts/run-tsgo.mjs -b tsconfig.projects.json: passed.OPENCLAW_CHECK_CHANGED_REMOTE_CHILD=1 node scripts/check-changed.mjs: passed all selected format, baseline/generator, lock, dead-code, typecheck, lint, and import-cycle lanes.OPENCLAW_BUILD_CACHE=0 pnpm build: passed and emitteddist/worker/workspace-rsync-receiver.js.Current head
8456fb8d48368ec609945018a35e4f71a934b6ebadds one CI-required test-harness correction after hosted run 31308026310 showed the three Linux boundary cases timing out: the capture wrapper had been given barersyncas its real binary and recursively invoked itself after being prepended toPATH. The harness now resolves the real binary first. Focused proof is 3/3 passed; format,git diff --check, automated autoreview, and TruffleHog are clean. Exact-head hosted CI run 31308547898 is required to finish green before landing.Production LOC: +75 net versus the branch base (+69 runtime ownership capability, +6 build/CI tooling). Tests: +302 net. The positive runtime delta establishes the worker-bundle receiver ownership boundary required for correctness across Apple and GNU rsync while preserving existing fencing and settlement invariants.
Blacksmith Testbox was unavailable because its delegated environment lacked the
blacksmithexecutable; other remote-provider doctor attempts timed out. Per trusted-source policy, heavy proof fell back locally. Hosted exact-head PR CI remains required before landing.Post-fix live AWS lifecycle proof is intentionally still open: deploying this unmerged branch would strand the production pointer across the manager ancestry and eventual squash merge. The exact dispatch/reconcile/reclaim lifecycle will be run after merge and deployment; this PR does not claim user acceptance or post-fix live AWS success.
AI-assisted. I understand the change and verified the owner boundary. No transcript links are included. No changelog change is included; release-note context is captured here.