Repository navigation
refactor: reuse fs-safe for directory scans - #159603
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 27, 2026, 8:15 AM ET / 12:15 UTC (Revision 3). ClawSweeper reviewWhat this changesThe branch replaces directory scans used by File Transfer preflight, installed-skill fingerprinting, and Claw workspace removal with fs-safe walking, and adjusts their tests. Merge readiness✅ Ready for maintainer review The PR remains useful because current main still has the local directory walkers. The published fs-safe contract and affected call sites reveal no definite introduced defect. Priority: P3 Review scores
Verification
How this fits togetherThese scans read filesystem trees before OpenClaw packages a directory, checks an installed skill, or removes a Claw workspace. They produce a bounded listing, a fingerprint, or a decision to retain the workspace. flowchart TD
A[Filesystem trees] --> B[fs-safe tree walker]
B --> C[File Transfer preflight]
B --> D[Skill fingerprint]
B --> E[Claw removal scan]
C --> F[Bounded entry list]
D --> G[Stored digest check]
E --> H[Retain or remove workspace]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource -20, Tests +15. Total -5 across 6 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Use fs-safe as the traversal owner while preserving preflight limits, existing skill fingerprints, and conservative workspace retention. Do we have a high-confidence way to reproduce the issue? Not applicable: the PR is an internal refactor, not a report of failing behavior. Its affected paths have focused tests and source-checkable contracts. Is this the best way to solve the issue? Yes: the pinned dependency already owns bounded, sorted filesystem walking, and the branch leaves the Plugin SDK contract unchanged. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 1ab9e1baec39. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
History |
3a53ec6 to
08ff4d3
Compare
|
Merged via squash.
|
* refactor: reuse fs-safe for directory scans * test(claws): align takeover fixture with fs-safe root
What Problem This Solves
OpenClaw maintains three recursive directory walkers that the released fs-safe package can now own.
User Impact
No intended user-visible change: directory fetch preflight keeps its ordering and limits, installed skills keep their existing fingerprints, and Claw removal preserves workspaces whose contents cannot be fully checked.
Why This Change Was Made
Use fs-safe 0.21.0's
Root.walkwith symlink inclusion for these complete directory scans, removing 20 production lines. Core and File Transfer already declare this released version. Callers import the dependency directly without widening the Plugin SDK facade.Preflight sorting preserves whole subtrees even when two distinct names compare equally by locale. Skill metadata exclusions, hard-link rejection, and Claw's missing-root behavior remain unchanged.
Evidence
The second CI run hit an inherited worker-installation type error from main. This branch is now rebased, with an identical patch, onto its canonical fix
57f12db99ee3dd53f265170cb1ae7bbe089a8eed. The four failed type graphs, SDK declaration preparation, and 77 bundle/npm provider tests pass on that fix; fresh PR CI remains required.Root.walkleaves omitted depth/entry budgets unlimited; directory fetch retains its explicit entry cap.check:changedstages passed. The initial invocation stopped on two missing comparator braces; corrected extension lint, the targeted preflight regression, and all remaining stages passed separately. Core/extension production and test types, unused-export scans, and repository guards are covered.