Repository navigation
perf(workers): cut repeated full-tree workspace hashing - #121365
Merged
Merged
Conversation
Contributor
|
🦞👀 Pull request received. I will update this pull request when review starts. |
steipete
marked this pull request as ready for review
August 10, 2026 03:20
Contributor
Author
|
Land-ready proof for exact head
|
Contributor
Author
|
Merged via squash.
|
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
Aug 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What Problem This Solves
Cloud-worker workspace reconciliation performs 4–6 remote and 4–6 gateway full content-hash passes per turn because each late-writer safety fence rebuilds a manifest independently. On large workspaces, unchanged files therefore pay the deterministic hashing cost repeatedly even though the separate fences must remain in place to detect concurrent writes.
Why This Change Was Made
The reconcile lifecycle now owns an in-memory content-hash memo shared by its safety fences. Entries are keyed by the file's stat identity (
dev,ino,size,mtimeNs, andctimeNs), so a fence can reuse a hash only while the filesystem still proves it is the same unchanged inode state. The remote memo crosses the short-lived SSH subprocess boundary in a bounded internal envelope; there is no persistent cache and no public protocol, configuration, or schema change.The repair also reuses local-node observations inside one preflight pass, hoists git enumeration while retaining per-attempt existence filtering, backs inbound quota polling off from 25 ms to 250 ms with a final authoritative scan, and reports one aggregate debug-duration record for the reconcile lifecycle. The quiescence lifecycle was extracted from a module that had grown beyond 700 lines so the ownership boundary remains reviewable.
User Impact
Cloud-worker workspace reconciliation avoids rehashing unchanged files across its safety fences. In the representative 1,000- and 20,000-file harnesses, deterministic content-hash work fell by 80% remotely (five passes to one) and 75% on the gateway (four passes to one).
Wall-clock results are deliberately more modest: median total time improved in 5 of 8 cases, was near-flat in one, and was slower in two one-file cases amid 7–38% run-to-run spread. The benchmark uses local child processes in place of real SSH handshakes and rsync transfers, so it is evidence for hash-work elimination rather than a production latency guarantee.
Release-note context: cloud-worker workspace reconciliation avoids rehashing unchanged files across safety fences.
Evidence
origin/main: 7 files passed, 60 tests passed.tbx_01kzmrnh41khp1begchx31dym7, command exit 0. Its linked Actions wrapper was cancelled by external lease cleanup after the remote command returned, so that wrapper is not claimed as green CI.git diff --check origin/main...HEAD: clean.Representative benchmark totals (baseline versus median of three after-runs):
Production code is +823/-410 (net +413), and tests are +361/-18. The one-off measurement harness was intentionally not shipped after the unused-file gate; the benchmark table remains the captured evidence. The positive production delta pays for bounded cross-process memo transport, reconcile-lifetime ownership and instrumentation, stat-safe hashing, and extracting the quiescence lifecycle from the previous >700-line module.