Repository navigation
refactor(config): reuse unset pruning branches - #148216
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, 8:27 PM ET / September 15, 2026, 00:27 UTC (Revision 2). ClawSweeper reviewWhat this changesThe PR shares configuration removal logic between leaf deletions and recursive pruning, with added coverage for immutability and array removals. Merge readiness✅ Ready for maintainer review Keep open: the focused cleanup remains useful, preserves existing behavior, and has no actionable correctness findings. Neither current main nor the latest release contains the consolidation. Priority: P3 Review scores
Verification
How this fits togetherOpenClaw’s configuration writer applies requested path removals before validation and persistence. This helper produces an updated configuration without modifying the caller’s input. flowchart TD
A[Configuration and removal paths] --> B[Validate path segments]
B --> C[Traverse objects and arrays]
C --> D[Shared removal and pruning]
D --> E[Updated configuration]
E --> F[Validation and persistence]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource -10, Tests +36. Total +26 across 2 files. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Keep one removal branch per container type while preserving immutable updates, pruning rules, and sequential path semantics. Do we have a high-confidence way to reproduce the issue? Not applicable: this PR claims a behavior-preserving refactor, not a defect fix; static comparison supports equivalent removal behavior. Is this the best way to solve the issue? Yes: reusing the existing pruning branches removes duplication within the established owner without adding APIs or changing persistence contracts. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 46d1bc761641. 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)
|
|
Merged via squash.
|
* commit '0945dabbe487213e95e84a72ad1aae3659e0e000': (115 commits) fix: omit automation service aliases from squash coauthors (#148883) test: restore services typecheck shard headroom (#148885) perf(trajectory): avoid native probes for truncation records (#148870) improve(gateway): load cron only when reload requests it (#143500) fix: resolve issue #146088 — [Bug]: The most recent Linux AppImage does not ship with the correct versions of libs needed to run (#148174) refactor(theme): share nonvirtual ANSI color lookup (#148717) perf(gateway): scope exact session row topology reads (#148836) improve(memory): reduce vector replacement overhead (#148201) fix(i18n): keep HTTP headers out of native translations (#147119) refactor(plugins): share source-root display formatting (#148646) fix(cron): reject blank script paths before mutations (#148787) refactor(config): share audit positional scanning (#148643) fix(test): restore infrastructure typecheck shard headroom (#148861) fix(release): harden package validation fallbacks (#148729) refactor(config): share leaf and descendant unset pruning (#148216) test: reuse prepared runtime for pristine preflight (#148858) fix(ui): settle global model drafts across agent switches (#148843) fix(queue): avoid repeated scans when cancelling backlogs (#148754) fix(logging): orphaned \\\\?\\ path markers corrupt redacted Windows diagnostics (#147542) refactor(hooks): share optional reply metadata projection (#148641) ...
What Problem This Solves
This consolidation of config unset removal and pruning is part of the maintainer-requested maintainability and duplication-reduction deliverable. Config traversal duplicated the leaf splice/delete behavior already owned by recursive pruning.
User Impact
No intended behavior change. Explicit unsets remain immutable, prune empty objects, retain empty arrays, reject the same invalid or blocked path segments, and interpret successive indexes against the updated candidate.
Why This Change Was Made
Represent a leaf removal with the existing prune marker, then use the existing array/object removal branches. The leaf condition remains before child access; cloning happens only after a change is known. Public signatures, write and validation callers, config formats, defaults and managed unset paths are unchanged.
Production: -10 lines. Tests: +36 lines. This mechanical refactor needs no changelog entry.
Evidence
77a494970f0fa56a807ac2171aeb44debc7379ed: 120 successful jobs and 17 planned skips. Selected type, lint, format, dependency and build gates passed. Workflow Sanity also passed.2621f97605fc83efd7226725cc4ee598ef3c9c08contains the exact reviewed owner and test bytes. The successive-index reporter title was shortened; source order and the complete target result bind that case.The evidence covers the immutable config-write boundary. No live operator session or migration execution is claimed; this change adds no persisted shape, migration, SDK, dependency or operator contract.