Repository navigation
improve(startup): avoid loading file writers for secret metadata - #148096
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review blockedAutomated review did not run, so no review verdict was produced. Reason: The input-safety check could not safely complete for this revision. ClawSweeper will not retry this unchanged revision. Next step: No contributor action is requested. Maintainers should inspect the linked workflow run. |
|
Codex review: needs maintainer review before merge. Reviewed September 14, 2026, 10:16 AM ET / 14:16 UTC (Revision 2). ClawSweeper reviewWhat this changesMoves atomic file writing into the existing secrets I/O adapter and directs shared parsing helpers to a lightweight record guard, reducing code loaded during secret-target discovery. Merge readiness✅ Ready for maintainer review The optimization remains useful: current main and the latest release retain the heavier import path. No introduced correctness or security defect was found, and the maintainer-labeled PR is protected from cleanup closure. Priority: P3 Review scores
Verification
How this fits togetherOpenClaw’s secret-target registry combines core and plugin metadata to identify configurable credential fields. Shared parsing supports discovery, while the secrets I/O adapter handles writes during apply and rollback. flowchart TD
A[Core and plugin metadata] --> B[Secret-target discovery]
B --> C[Lightweight parsing helpers]
B --> D[Available credential fields]
E[Validated secrets plan] --> F[Secrets I/O adapter]
F --> G[Atomic writes and rollback]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource -1. Total -1 across 3 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep metadata parsing lightweight while retaining the existing atomic writer, permission handling, and rollback behavior in the secrets I/O adapter. Do we have a high-confidence way to reproduce the issue? Not applicable as a behavioral bug reproduction: source confirms the unnecessary import dependency, and the PR reports a cold-import comparison. No runtime commands or tests were executed during this read-only review. Is this the best way to solve the issue? Yes. Moving the unchanged writer to its existing consumer’s I/O adapter and bypassing a broad re-export removes unnecessary dependencies without adding another implementation or compatibility mode. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 716938393e34. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
833c0a3 to
da1a30c
Compare
da1a30c to
bd75612
Compare
|
Merged via squash.
|
* origin/main: perf(secrets): keep pure helpers out of file writer imports (#148096) perf(models): normalize suppression policy once per compilation (#148428) test: route provider integration and wizard recovery tests correctly (#148504) test: reuse prepared bundled plugins in startup corpus (#148465) fix(agents): attribute tool preparation delays to the correct stages (#148349) refactor: remove redundant Parallels source checks (#148394) fix(test): avoid timeout failures before descendant readiness (#148410) fix: open browser side panel without creating a dashboard (#148471)
What Problem This Solves
Loading secret-target metadata pulls filesystem-writing machinery through shared parsing helpers.
User Impact
Metadata discovery loads less code while retaining the complete secret-target registry and existing account behavior.
Why This Change Was Made
Move the atomic text writer into the existing secrets I/O adapter, already imported by its only caller, and make the shared record guard point directly to its canonical leaf module. The writer and its filesystem initialization wrappers move together. A duplicate adjacent doc comment is also removed.
Production is +23/-24 across three files; tests are unchanged. Persistence compatibility is preserved: the writer body is byte-identical, including private-file mode, restored nondefault modes, temporary-file prefix, and existing private-directory handling. Both apply/rollback call sites retain their arguments.
Evidence
The unchanged, unmocked registry/docs test exercises real public plugin artifacts through Jiti. Distinct transformed paths fall from 517 to 469: 48 removed, none added. Both traces have zero filesystem cache hits. The private writer, atomic replacement and broad utilities disappear from that import path; the executable Buzz account resolver remains. This establishes removed cold-import work, not a CI wall-time benchmark.
All 90 focused candidate cases passed, covering registry/docs parity, SDK/Buzz contracts, external discovery, apply/rollback, filesystem defaults and legacy-marker migration. All 29 classified checks passed. Independent P2 review found no actionable issues; the full build passed. The build also reported the existing unrelated UI startup-size warning, retained as a separate follow-up.
The patch was rebased byte-for-byte onto main's inherited UI lint repairs. Both formerly failing UI files pass the normal targeted lint command on that base.