Repository navigation
refactor: replace duplicated filesystem helpers with fs-safe - #148442
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. |
|
Codex review: needs maintainer review before merge. Reviewed September 14, 2026, 5:18 PM ET / 21:18 UTC (Revision 6). ClawSweeper reviewWhat this changesReplaces duplicated filesystem implementations with fs-safe helpers while retaining OpenClaw’s path checks, write guards, snapshot formats, and recovery behavior. Merge readiness✅ Ready for maintainer review The consolidation remains useful and distinct from its merged prerequisites. No blocking introduced defect was found; the protected maintainer PR should remain open. Priority: P2 Review scores
Verification
How this fits togetherOpenClaw’s filesystem adapters support agent writes, sandbox operations, generated files, package installation, and snapshots. They apply OpenClaw policy around the shared library’s file operations. flowchart TD
A[Agent and sandbox requests] --> C[OpenClaw filesystem adapters]
B[Artifacts and package updates] --> C
C --> D[Path and execution checks]
D --> E[Shared fs-safe operations]
E --> F[Files and snapshots]
E --> G[Publication and recovery results]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource -1041, Tests +34, Other -1. Total -1008 across 33 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep OpenClaw’s admission, durability, and recovery policy in thin adapters while fs-safe owns the shared filesystem mechanics. Do we have a high-confidence way to reproduce the issue? Not applicable: this PR consolidates existing implementations; source comparisons establish the duplication without requiring a failing runtime reproduction. Is this the best way to solve the issue? Yes: the released dependency provides the required primitives, while the adapters preserve OpenClaw-specific policy and serialized contracts. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against f48695a2abc7. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (5 earlier review cycles)
|
Remove the duplicate inventory entry so compact CI shard manifest generation retains one execution group and its strict timing uniqueness guard.
* perf(sessions): reduce redundant SQLite scans * style(acp): avoid shadowed query builder names * test(ui): exercise session eviction through the wizard choice button * test(ui): wait for the current publication subscription * test(ci): protect wizard recovery broker routing Retain the routing regression from #148442 while inheriting the canonical registration repair in #148504. Require one infra registration and exclusion from the thread-based wizard project.
|
Merged via squash.
|
* perf(sessions): reduce redundant SQLite scans * style(acp): avoid shadowed query builder names * test(ui): exercise session eviction through the wizard choice button * test(ui): wait for the current publication subscription * test(ci): protect wizard recovery broker routing Retain the routing regression from openclaw#148442 while inheriting the canonical registration repair in openclaw#148504. Require one infra registration and exclusion from the thread-based wizard project.
…w#148442) * refactor: reuse fs-safe filesystem owners * fix(ci): register inference recovery tests once Remove the duplicate inventory entry so compact CI shard manifest generation retains one execution group and its strict timing uniqueness guard. * test(browser): assert structured download guard error
What Problem This Solves
OpenClaw still duplicates filesystem code now available in fs-safe 0.11.0, adopted in #148087.
User Impact
Filesystem operations retain OpenClaw’s path policy, execution guards, publication, and recovery behavior. Recursive removal avoids rereading the parent directory for every child. Borrowed-handle copies use fs-safe’s strict file identities and no-progress diagnostics.
Why This Change Was Made
Remove 1,041 net production lines by using the released guest Python program, producer isolation, directory identities, case probing, recursive removal, and descriptor copy/hash/overwrite operations. OpenClaw keeps transport and admission, durability requirements, rollback decisions, and persisted digest field names. The superseded Python modules and private temporary-file owner are deleted.
The change adds filesystem regression coverage and removes one obsolete assertion-baseline entry. Canonical wizard registration is supplied by #148504, and the independent routing assertions are also on main through #148366; final integration preserves them once. Dependency pins and streamed-create compatibility are already on main through #148087. Current-main integration retains both the existing
buildRandomTempFilePathand the newprobePathCaseInsensitiveSyncexports.Evidence
not-filecode instead of retired wording. The old assertion reproduced the CI failure; all 17 tests in its file pass with the save-count and outside-directory checks intact. Targeted lint passed in a flat checkout with dependency-isolation guards enabled.The inherited Radius boundary failures are resolved by integrating canonical #148504. Both the actual core-graph guard and the deep-import boundary contract pass after integration; no alternative Radius implementation is added.
An earlier hosted run also encountered native
fs.rm/ENOTEMPTYduring an unchanged memory test’s teardown. The same memory lane subsequently passed; the exact late writer remains unproven, and this PR adds no speculative memory repair or removal retry.Earlier implementation proof is retained with its source identity; it is not relabeled as final-head execution. Required hosted CI is green for unchanged head
9e666f59b2f17115e6a02c30370917dbc11e3ec5: run 34897239695, attempt 2 finished with 121 passing checks and 16 skips. Local filesystem proof does not claim a deployed remote backend, Windows live filesystem behavior, broad concurrent races, crash durability, or final link-to-copy fallback. The Linux package update cell did not start a Gateway or use provider credentials.The first CI attempt had one five-second Gateway shutdown timeout. The unchanged two-case test passed locally, a temporary trace probe passed and was exactly removed, and all 327 tests in the original 27-file execution order passed locally with reporter order verified. A single retry of the failed job then completed all six packed groups successfully. The original timeout cause remains unproven; no timeout, assertion, or runtime behavior was changed.