Repository navigation
improve: reduce worktree filesystem stalls and archive syncs - #146906
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
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, a member of
Security review is still recommended before merge when the dependency graph change is intentional. |
|
Codex review: blocked before merge. Reviewed September 13, 2026, 7:02 AM ET / 11:02 UTC (Revision 4). ClawSweeper reviewWhat this changesThe PR consolidates worktree cloning through fs-safe, moves APFS metadata reads off the Gateway thread, and reduces durability syncs during temporary archive extraction. Merge readiness⛔ Blocked before merge - 4 items remain This remains useful work absent from fetched main. No blocking code defect was established; the protected, maintainer-authored PR should remain open. Priority: P2 Review scores
Verification
How this fits togetherManaged worktrees give agent tasks isolated Git checkouts, with filesystem acceleration supplying their contents. Archive extraction prepares downloaded packages before installation. flowchart TD
A[Agent task] --> B[Managed worktree service]
B --> C{Filesystem acceleration available}
C -->|Yes| D[Isolated native helpers]
C -->|No| E[Normal Git checkout]
D --> F[Validated task checkout]
E --> F
G[Downloaded package archive] --> H[Guarded extraction and installation]
Decision needed
Why: APFS and archive evidence is positive, but the available Linux host could not mount Btrfs; accepting the remaining platform uncertainty requires maintainer judgment. Before merge
Agent review detailsSecurityNone. PR surfaceSource +78, Tests +234, Docs +6, Config +2, Other +10. Total +330 across 37 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep fs-safe as the cloning owner and preserve durable archive defaults, with Btrfs integration and fallback behavior either demonstrated or explicitly accepted before landing. Do we have a high-confidence way to reproduce the issue? Not applicable as a discrete bug report: this is a performance consolidation, with measured APFS results and an explicitly unverified Btrfs path. Is this the best way to solve the issue? Yes, consolidating cloning through the existing dependency while retaining host authority checks and archive defaults is a maintainable approach; platform acceptance remains separate. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 0a6bc07ec391. LabelsLabel 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
History |
57a824e to
f3ae9a9
Compare
|
Maintainer disposition for the platform and migration notes: The optional native-package prerequisite is intentional. Explicitly disabled or unavailable native helpers select ordinary Git checkout with its full disk-space allowance; the optimization does not weaken capacity or integrity checks. This is a pre-release acceleration cutover, and the documented Git fallback remains the supported non-native path. The final installed-package Linux proof at Native Btrfs creation, cancellation, and compatibility with CLI-created templates remain an explicit validation gap: Btrfs is absent from The data-model warning is inapplicable. Required CI is green: https://github.com/openclaw/openclaw/actions/runs/34752280934. The infrastructure import boundary is preserved without exceptions, and the relocated built worker plus independent reviews pass. No actionable source finding remains. |
|
Merged via squash.
|
* temp/pr-146802: (51 commits) improve: reduce worktree filesystem stalls and archive syncs (#146906) fix(ui): avoid extra chat rail work while replies stream (#146883) improve(ui): speed up populated Usage timelines (#146947) test(gateway): retain auth recovery failure diagnostics (#146925) fix(tests): create private temporary home directories (#146931) fix(backup): preserve discovery under concurrent state writes (#146912) fix: keep queued deliveries in their original state directory (#146917) fix(discord): settle voice waveform work before releasing input (#146885) fix(memory): preserve newer indexes and disclose automatic rebuild costs (#146908) fix: retain route ownership while discovering conversations (#146927) refactor: reuse plugin fixture shell runner (#146920) fix(worker): stop preparing disabled live previews (#146896) fix(runtime): support Bun across tooling suite (#146807) chore(i18n): refresh native locales (#146924) perf(secrets): limit expiry metadata to transient credentials (#146882) fix(ui): preserve queued refreshes during session discovery (#146535) test(ui): wait for quiet scrolling and close named file tabs (#146836) fix(ui): prevent Usage hour filters from freezing during DST (#146919) test(ui): share browser page cleanup across layout fixtures (#146805) ci: balance complete PR runtime test groups (#146916) ...
* temp/pr-146799: (70 commits) test: reuse explicit fallback config fixtures (openclaw#146948) fix(computer): return fresh window observations after actions (openclaw#146822) refactor(feishu): remove unreachable requester topic selection (openclaw#146904) improve(gateway): reduce CPU spent listing agent-owned sessions (openclaw#137745) fix(ui): avoid recapturing chat drafts during UI updates (openclaw#146884) fix(ui): show system uptime in the debug overlay (openclaw#146960) fix(retry): honor waits beyond the native timer limit (openclaw#145718) fix(ui): keep chat history idle when run status changes (openclaw#146802) fix(ui): reuse persisted text during chat streaming (openclaw#146831) refactor(qa): share harness drift result construction (openclaw#146903) test(agents): coordinate settings lock contention (openclaw#146949) fix(worker): avoid repeatedly serializing screenshot history (openclaw#146907) fix(secrets): stop buffered upload writes after cancellation (openclaw#146840) perf(doctor): avoid unnecessary state runtime imports (openclaw#146926) improve: reduce compaction request estimation work (openclaw#146961) fix(ci): wait for forwarded avatar imports before assertions (openclaw#146729) perf(workers): skip configured Git author lookups (openclaw#146833) fix: admit borrowed memory writes through the agent database owner (openclaw#146760) fix(discord): prevent voice playback gaps and stale turn controls (openclaw#146798) improve: reduce worktree filesystem stalls and archive syncs (openclaw#146906) ...
* commit 'ccfd2377cd07d1ad3a583ba64d08e29a065f7061': (1587 commits) fix(ui): avoid recapturing chat drafts during UI updates (#146884) fix(ui): show system uptime in the debug overlay (#146960) fix(retry): honor waits beyond the native timer limit (#145718) fix(ui): keep chat history idle when run status changes (#146802) fix(ui): reuse persisted text during chat streaming (#146831) refactor(qa): share harness drift result construction (#146903) test(agents): coordinate settings lock contention (#146949) fix(worker): avoid repeatedly serializing screenshot history (#146907) fix(secrets): stop buffered upload writes after cancellation (#146840) perf(doctor): avoid unnecessary state runtime imports (#146926) improve: reduce compaction request estimation work (#146961) fix(ci): wait for forwarded avatar imports before assertions (#146729) perf(workers): skip configured Git author lookups (#146833) fix: admit borrowed memory writes through the agent database owner (#146760) fix(discord): prevent voice playback gaps and stale turn controls (#146798) improve: reduce worktree filesystem stalls and archive syncs (#146906) fix(ui): avoid extra chat rail work while replies stream (#146883) improve(ui): speed up populated Usage timelines (#146947) test(gateway): retain auth recovery failure diagnostics (#146925) fix(tests): create private temporary home directories (#146931) ... # Conflicts: # test/tsconfig/tsconfig.core.test.agents-other.json # test/tsconfig/tsconfig.core.test.agents-root.json
…w#146906) * perf: consolidate filesystem copy and archive operations * fix: reconcile fs-safe 0.10 integration checks * refactor: keep native filesystem execution inside infra
What Problem This Solves
Managed worktrees duplicate native filesystem cloning code, APFS index preparation reads metadata on the Gateway thread, and disposable archive extraction performs unnecessary durability syncs.
User Impact
APFS metadata runs in bounded background batches, Linux Btrfs acceleration no longer needs the btrfs executable, and temporary plugin/hook/skill extraction skips redundant syncs. Normal archive extraction keeps OpenClaw's durable default. Existing Git fallback, APFS ACL policy, ReFS per-file authority checks, and cancellation cleanup remain in place.
Why This Change Was Made
Upgrade core and both bundled direct consumers to fs-safe 0.10.0 and use its existing copy API with strict clone policy. Read-only metadata uses a bounded worker pool; write-capable native work uses supervised subprocesses and live input admission so cleanup cannot race an unfinished clone. This keeps the Gateway's native-off default and respects explicit operator overrides without adding a configuration option or library API. APFS index rewriting also allocates its final buffer once instead of making two additional full-index copies.
The dependency includes a native-off fallback and platform packages. Exact-version dependency cooldown exceptions cover the reviewed fs-safe release and JSZip 3.10.2; old fs-safe pins and exceptions are removed.
Evidence
The compiled 8,198-entry APFS comparison verified actual batches of at most 512 paths, unchanged source indexes/OIDs/checksums/modes, same-size edits with restored mtimes, and real managed-service template reuse. Index construction used one large backing buffer instead of three. The measured design favored responsiveness: median main-thread stalls fell from 13.5 to 6.5 ms, while index translation rose from 157.2 to 191.1 ms and aggregate sampled heap allocation increased. These are scoped measurements before the final array-style/receiver-type lint cleanup, not a general checkout-throughput claim.
Fresh Linux installed-package proof passed on Node 24.19 with fs-safe 0.10.0 and JSZip 3.10.2: all six ZIP/TAR default/true/false durability cells, temporary cleanup, actual native-disabled Git worktree creation/removal, and real low-space refusal on a one-GiB ext4 volume without publishing a branch or registry record. Both phases verified the product files and wrapper source/tree/carrier binding before and after execution; owned leases are stopped. Backing run: https://github.com/openclaw/openclaw/actions/runs/34753088762.
Native Btrfs creation/reuse/cancellation remain unverified: the configured Testbox has no Btrfs filesystem or shipped module. This platform-proof limitation and the intentional optional-native-package prerequisite are accepted for landing with the documented, tested Git fallback. No alternate provider was started. Worker IPC and dependency cooldown metadata introduce no persisted-state migration.
Required CI passed on
842c5c6073fbb417dd0a40b2a320f7548ee15ecb: https://github.com/openclaw/openclaw/actions/runs/34752280934. The earlier fixture and import-boundary failures are repaired; the inherited file-tab selector fix came from main.No OpenClaw release or live Gateway deployment is included.