Repository navigation
refactor(plugins): share managed npm package traversal - #140040
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 6, 2026, 7:06 AM ET / 11:06 UTC. ClawSweeper reviewWhat this changesShares npm package-directory traversal between plugin installation and host dependency-link repair while preserving their distinct filtering, ordering, and filesystem-error behavior. Merge readiness✅ Ready for maintainer review This remains a useful, bounded refactor absent from the inspected main revision. No actionable introduced defect was found, and the maintainer-authored, protected PR should remain open for normal landing. Priority: P3 Review scores
Verification
How this fits togetherOpenClaw scans managed npm directories to identify newly installed dependencies and repair plugins’ links to the host package. The shared walker supplies package paths to those two operations, each retaining its own selection rules. flowchart TD
A[Managed npm directory] --> B[Shared package walker]
B --> C[Root and scoped entries]
C --> D[Installer selection rules]
C --> E[Peer repair selection rules]
D --> F[New dependency scan]
E --> G[Audit and repair host links]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource -17, Tests +201, Other 0. Total +184 across 5 files. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Keep one internal traversal owner with explicit caller-specific selection and ordering, backed by filesystem characterization at the installer and repair boundaries. Do we have a high-confidence way to reproduce the issue? Not applicable: this PR addresses duplicated implementation rather than a reported runtime defect; source comparison and filesystem characterization support behavioral equivalence. Is this the best way to solve the issue? Yes: the extraction removes duplicated traversal without merging the callers’ intentionally different policies or adding a public API. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 8029fcccab8b. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (3 earlier review cycles)
|
67b6f77 to
92a0796
Compare
|
Merged via squash.
|
* origin/main: (47 commits) ci: record CPU time for Node test jobs (openclaw#140054) test(crabbox): consolidate wrapper boundary coverage (openclaw#140058) fix(test): keep native filesystem access checks portable (openclaw#140047) fix: preserve models when OAuth preparation fails (openclaw#139951) feat(update): recover failed updates with bounded repair (openclaw#139495) refactor(plugins): share managed npm package traversal (openclaw#140040) chore(ui): refresh control ui locales (openclaw#140059) refactor(auth): share profile failure state reset (openclaw#140049) fix(cron): surface skipped on-exit payloads when jobs are busy (openclaw#139987) fix(codex): preserve exec-server WebSocket backpressure under Bun (openclaw#140048) fix(agents): ground exec approvals in tool results (openclaw#140043) refactor(policy): reuse authored policy value helpers (openclaw#140019) docs: keep ClawSweeper status inspection read-only (openclaw#139958) fix: reduce task maintenance stalls with large histories (openclaw#140038) fix(code-mode): identify unawaited promise output (openclaw#140028) fix(test): release memory search fixtures after failed phases (openclaw#140013) test(gateway): isolate Serve hello lifecycle fixtures (openclaw#140044) fix(microsoft-foundry): bound Entra token retention across accounts (openclaw#127216) fix(process): preserve the cause of cleanup observation failures (openclaw#140015) fix: clear Side chat when its parent conversation is deleted (openclaw#139974) ...
What Problem This Solves
Managed npm installation scans and host peer-link repair duplicated the same root/scoped package traversal, making their filesystem error handling and ordering harder to maintain consistently.
Why This Change Was Made
One directory walker now serves both owners. Each caller retains its own entry policy and ordering: installation scans include package symlinks, while peer repair operates only on real directories. Missing directories remain tolerated; other native errors remain visible. Production decreases by 17 lines.
User Impact
Package discovery and peer repair preserve their existing behavior, including malformed installer scopes and packages whose directories disappear during enumeration. The installer rollback and quarantine paths are unchanged.
Evidence
Related: #135599. This is an independent installer-owner refactor with real filesystem proof; no registry download or Gateway behavior is claimed.
The rebase onto main resolved only an assertion-baseline conflict, preserving both main's unrelated reductions and this PR's two reduced entries. All three production files and the characterization test are byte-identical to the reviewed and tested commit. The exact assertion ratchet passed again after resolution.