Repository navigation
improve(plugins): reduce mutable argument handling overhead - #152154
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 18, 2026, 5:01 PM ET / 21:01 UTC (Revision 2). ClawSweeper reviewWhat this changesThe PR avoids allocating graph-traversal state when plugin arguments cannot be deeply frozen plain data. Merge readiness✅ Ready for maintainer review This remains a useful, bounded optimization absent from current main. No actionable correctness or security defect was found, and the earlier merged optimization does not supersede it. Likely related people: steipete, with high-confidence routing from prior merged work on the same classifier. Priority: P3 Review scores
Verification
How this fits togetherOpenClaw classifies argument and configuration objects so plugin calls and configuration readers can safely reuse immutable data. This shared classifier feeds argument restoration and in-memory caching decisions. flowchart TD
A[Arguments and configuration] --> B[Immutable data classifier]
B --> C{Previously validated?}
C -->|Yes| F[Reuse immutable data]
C -->|No| D{Plain frozen root?}
D -->|No| G[Normal mutable data handling]
D -->|Yes| E[Validate complete graph]
E -->|Valid| F
E -->|Invalid| G
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +3. Total +3 across 1 file. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Retain the shared classifier and its positive cache while rejecting ineligible roots before allocating traversal state. Do we have a high-confidence way to reproduce the issue? Not applicable as a functional bug: source confirms avoidable traversal allocations, and the author reports comparative component measurements; this read-only review did not execute benchmarks. Is this the best way to solve the issue? Yes. The early check reuses the existing classification rule without changing callers, cache lifetime, or plugin APIs. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against eed0fcc30c4b. 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)
|
63a5d39 to
bbb53f9
Compare
|
Merged via squash.
|
…n-20260918-v4 * origin/main: (81 commits) fix: retire failed setup plugins without replaying facade initialization (#152026) fix(test): select Node for built runtime recovery fixtures (#152162) refactor(auth): reuse privately assembled choice groups (#152166) fix: preserve chat media delivery and session boundaries (#152079) fix: keep stale Stop messages from canceling replacement sessions (#152116) improve(plugins): reduce mutable argument handling overhead (#152154) fix(scripts): prevent host tooling drift from blocking PR workflows (#152078) improve: reduce model capability preparation work (#152128) fix: stop marking delivered scheduled reports as failed (#152165) fix: start background context maintenance after durable turns (#151936) fix(models): avoid ambient state reads during prepared selection (#152119) feat: recover abandoned Crabbox source staging (#152006) chore(ui): refresh control ui locales (#152098) fix(ui): keep cloud startup prompts and progress in chat (#152024) fix: report completed subprocess cleanup after cancellation (#152107) perf(reply): reuse normalized inbound text (#152110) fix(cron): paused future one-shots disappear after Run now (#152126) perf(sessions): reuse rows and skip discarded terminal labels (#152109) fix(ui): keep keyboard-focused automation controls clear of sticky actions (#152135) fix(ui): load remote images in compact activity previews (#152045) ...
What Problem This Solves
Plugin calls repeatedly allocate traversal state while checking ordinary mutable message objects for immutability.
User Impact
Plugin argument handling does less allocation work for mutable message payloads. Plugin behavior, mutation handling, and object identity remain unchanged; no configuration or migration is required.
Why This Change Was Made
Reject roots that cannot be deeply frozen plain data before allocating the traversal set and queue. Retain the existing positive cache and full graph validation for eligible roots.
Evidence