Repository navigation
fix(file-transfer): preserve plugin filesystem boundary - #159654
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: blocked before merge. Reviewed September 27, 2026, 9:32 AM ET / 13:32 UTC (Revision 3). ClawSweeper reviewWhat this changesThe File Transfer plugin switches directory preflight from a direct filesystem-package import to the Plugin SDK’s rooted filesystem API and recursively lists entries before creating an archive. Regression provenancePossible regression — suspected (reviewed change). No predecessor PR is attributed. Merge readiness⛔ Blocked before merge - 4 items remain Keep open. Current main still violates the plugin import guard, so the repair is useful. The previous blocking finding remains: directory preflight can process every child of a wide directory before enforcing its 5,000-entry limit. Priority: P2 Review scores
Verification
How this fits togetherFile Transfer receives an authorized directory request on a paired node, checks its entries and limits, then creates a capped archive for transfer. The plugin obtains rooted filesystem access through the Plugin SDK. flowchart LR
A[Directory fetch request] --> B[Authorized directory]
B --> C[Rooted SDK traversal]
C --> D{Entry limit exceeded?}
D -->|Yes| E[Reject preflight]
D -->|No| F[Create capped archive]
F --> G[Transfer result]
Before merge
Findings
Agent review detailsSecurityNone. PR surfaceSource +2. Total +2 across 1 file. View PR surface stats
Review metricsNone. Merge-risk optionsMaintainer options:
Copy recommended automerge instructionTechnical reviewBest possible solution: Use the existing SDK Root.entries iterator with sorted order and a remaining-entry budget, preserve identity and symlink checks, and cover prompt rejection of a directory wider than the cap at the node-host entry point. Do we have a high-confidence way to reproduce the issue? Yes, from source: current main has the direct import rejected by the guard, and the proposed Root.list path demonstrably does all sibling work before its count check. This read-only review did not execute either path. Is this the best way to solve the issue? No. Returning to the Plugin SDK is the right boundary, but Root.list loses the work bound; the existing sorted, bounded Root.entries operation is a narrower repair. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 0edae198d278. LabelsLabel changes:
Label justifications:
EvidenceAcceptance criteria:
What I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (2 earlier review cycles)
|
a695601 to
b7b8ca2
Compare
What Problem This Solves
The directory-scan refactor in #159603 imported
@openclaw/fs-safe/rootdirectly from the file-transfer plugin. That violates the plugin dependency boundary and failssrc/infra/fs-safe-import-boundary.test.tson current main. It was exposed by the main rebase for #159554; the failing source file is untouched by that CLI PR.Why This Change Was Made
Return directory preflight enumeration to the existing
openclaw/plugin-sdk/security-runtimerootedlistcontract. The SDK deliberately keeps the newerRoot.walkcapability core-only, so this fix does not widen it or add an exception to the import guard. The traversal preserves identity binding, bounded depth-first output, deterministic ties between locale-equivalent names, hidden entries, and symlinks without following their targets.User Impact
No intended output, configuration, permission, or SDK change. File-transfer preflight retains its existing behavior while using the supported plugin dependency surface. No changelog entry is needed for this unreleased main regression.
Evidence
extensions/file-transfer/src/node-host/dir-fetch.tsas the import-boundary violation.tbx_01m3hex2x923k0pd236tmqyvpq(run): original-source boundary control reproduced the exact failure (2.36 s); the repaired boundary and plugin/test-helper siblings passed all 25 tests (3.84 s);pnpm test:extensions:batch file-transferpassed 33 files / 354 tests, with one existing skip (66.49 s).check-changedpassed (464.85 s), andpnpm buildpassed (383.27 s). The build emitted non-fatal Control UI gzip advisories. Testbox proof used tree9fe37c4085a0bc89e76d829b8e3ce439746b7183, matching pre-rebase heada6956017ff16c0c1a3928340560d367af15a7cd9. Lease stopped and verified completed.32ba81a40d9d57065280aef6a25fed0b39223f21is patch-identical, with all affected dependency files unchanged and no duplicate fix on main. Current head isb7b8ca2b94a035b40b82d004a928143dc4f00267; its own CI run 36322187124 passed. Merged ase8b091921ef03a016985cbb9a55abf0766470773on 2026-09-27 at 13:36 UTC while the authoring lane was closing out. The merged source matches the proved repair.