Repository navigation
refactor(plugins): deslop memory, migration and utility plugins - #158532
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 26, 2026, 8:04 AM ET / 12:04 UTC (Revision 11). ClawSweeper reviewWhat this changesThe branch consolidates repeated code across bundled memory, migration, channel, and utility plugins and moves MXC command preparation inside sandbox temporary-directory cleanup. Merge readiness⛔ Blocked before merge - 5 items remain Keep open. Current main still lacks the MXC cleanup fix and much of the plugin consolidation. I found no definite introduced defect, but upgrade evidence for the pinned ACPX change remains incomplete. Priority: P3 Review scores
Verification
How this fits togetherBundled plugins handle Gateway and CLI requests through Plugin SDK contracts, producing memory results, channel responses, diagnostics, and sandbox actions. Doctor processes existing configuration and state before affected plugin runtime paths start. flowchart LR
A[Gateway and CLI requests] --> B[Plugin SDK contracts]
B --> C[Bundled plugin actions]
D[Existing config and state] --> E[Doctor migration]
E --> C
C --> F[Memory and channel results]
C --> G[Sandbox and diagnostic effects]
Before merge
Agent review detailsSecurityNone. PR surfacePR surface statistics unavailable: the file list is incomplete. Review metricsNone. Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Retain the shared plugin owners and MXC cleanup, then establish ACPX upgrade behavior with a published updater running against the pinned candidate and copied legacy state. Do we have a high-confidence way to reproduce the issue? Yes. Current-main source places MXC bridge preparation after temporary-directory creation but before cleanup begins; an injected preparation error reaches that path. I did not execute the regression in this read-only review. Is this the best way to solve the issue? Unclear for the full branch until its ACPX upgrade path is verified on the pinned candidate. The inspected cutovers reuse existing plugin and SDK owners, and the MXC cleanup is placed at the failing boundary. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 1197afde91d2. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (10 earlier review cycles; latest 8 shown)
|
3a2f0b9 to
1ca310d
Compare
1ca310d to
6c2fcc2
Compare
9958370 to
d5e2f6a
Compare
Consolidate plugin-local flows and use existing SDK owners while preserving manifests, configuration, model-facing tools, migration mapping, storage and protocol contracts. Fix cleanup of the MXC sandbox temp directory when command bridge preparation fails.
Use concrete file-content and file-diff overloads instead of a generic union that exceeds tsgo type complexity. Runtime normalization remains unchanged.
d5e2f6a to
045cdcd
Compare
…claw#158532) * refactor(plugins): deslop memory, migration and utility plugins Consolidate plugin-local flows and use existing SDK owners while preserving manifests, configuration, model-facing tools, migration mapping, storage and protocol contracts. Fix cleanup of the MXC sandbox temp directory when command bridge preparation fails. * refactor(diffs): retain concrete normalized file types Use concrete file-content and file-diff overloads instead of a generic union that exceeds tsgo type complexity. Runtime normalization remains unchanged. * refactor(mxc): keep baseline input type private * refactor(plugins): preserve cleanup and guarded projection contracts * refactor(agentsapi): preserve main projection and prompt contracts
What Problem This Solves
Repeated plugin plumbing, forwarding layers, and local copies of shared helpers make equivalent flows harder to maintain. This sweep consolidates those paths across memory, migration, and utility plugins.
User Impact
The cleanup preserves plugin manifests, configuration, setup flows, model-facing tool contracts, migration behavior, memory storage and retention, pairing authority, and protocol/authentication formats. MXC now removes its temporary sandbox directory when command preparation fails. The memory-wiki README also correctly lists Obsidian search as a write-scoped RPC.
Why This Change Was Made
Measured reduction: 1,535 net runtime production lines plus 26 net build/tooling lines. Tests add 35 net lines; the assertion baseline shrinks by one line. No SDK exports, package dependencies, manifests, or generated assets change.
Fixes found along the way
MXC allocated its sandbox temp directory before entering the cleanup scope. A command-bridge preparation error therefore leaked the directory. The regression failed on the original implementation with the leaked directory present; preparation now runs inside the existing
try/finally.Evidence
Linux validation used Blacksmith Testbox with Node 24.19.0 / pnpm 12.4.2:
tbx_01m3e0rcwrnmxzx2k2dwjb46sm(run): 3,048 tests passed, 62 existing skips; 214 files passed, two skipped.pnpm test:extensions:batch diagnostics-prometheus onepassword firecrawl a2a logbook diffs canvas openshell mxc migrate-hermes migrate-claude memory-lancedb memory-wiki acpx agentsapicovered the package-bearing plugins.pnpm test extensions/device-pair extensions/active-memorycovered all four owning shards for the two manifest-only plugins rejected by the batch planner.pnpm test src/auto-reply/reply/inbound-context-marker.test.ts src/channels/plugins/contracts/channel-import-guardrails.test.ts.tbx_01m3dtnajm26vbd8hxv0jhp8a4(lease run):node scripts/check-changed.mjs --base origin/main --timedpassed in 589.97 s, including production/test typechecking, dead exports, boundaries, lint, and storage guards.pnpm test:extensions:batch memory-wiki memory-lancedb onepassword openshellpassed: 1,118 tests, 78 files, two existing skips (146.55 s). Finalpnpm buildpassed in 418.25 s, including SDK exports and declarations.pnpm release:checkalso passed (1,029.41 s), including fresh-install runtime smoke and SDK consumer compilation.The published-driver × candidate ACPX cell also passed (248.47 s): the unmodified installed
[email protected]updater consumed synthetic legacy gateway/lease state and installed candidate2026.9.6. A task-private overlay ofacpx-openclaw-tools-bridgebound the core package and separately shipped ACPX package to the candidate source/artifact hashes. It checked automatic migration before standalone Doctor, preserved archived legacy bytes, then invoked the registered lazy ACPX runtime: both owned wrappers terminated, the missing ordinary lease retired, and the uncertain missing-probe lease remained open. This Linux/manual-restart cell does not claim a live provider turn or updater-owned service restart. The test exited successfully; automatic diagnostic-artifact publication reported a warning, so the execution log was retained directly. Tested source tree:e6d56e5766cc48d9c7d36b268c35b266bda56098, identical to the pre-rebase commit3a2f0b97228e31d48002c3f096c6090c229dc0c3.Earlier integrated proof used base
dac6274dae5833fa0d189c2ccd88ec2709b3f7a7. The sole conflict preserved both main's optional link extraction and this PR's normalization cleanup. The integrated wiki review is scoped-clean; ACPX source and its state contracts are unchanged. The final integrated run ontbx_01m3e0rcwrnmxzx2k2dwjb46smpassed: check-changed 709.64 s; package-bearing plugin batch 376.27 s; manifest-only plugin suites 68.81 s; cross-shard consumers 33.14 s; build 471.81 s. ClawSweeper completed its review of1ca310da546with no actionable findings.Gate repairs retained concrete Diffs overloads, made an unused MXC type private, restored house-style object projections, preserved LanceDB primary-error precedence outside
finally, and retained OpenShell's guarded normalizer. Assertion ratchets only shrink.The prior hosted run also exposed an unrelated race from newer main in
workspace-sync-tunnel.git.test.ts: rsync renames a temporary file between directory enumeration andlstat. PR #158443 owns the fix (586325fb03e8c6ffd2a633710a613bb15a17b106), its deterministic regression, and the successful 879-Node/124-Bun shard replay. This branch does not include that unrelated repair.Landing rebase round 1: rebased onto
3b13311d7794f16814b4d5bdd22cf59d8d2fecca, including main's suppression fixes20f3170d367and256abd76af3. No suppression-inventory change was made. Retained main's prompt imports and behavior; main's ACPX state adoption and backup-resource additions are preserved. Dropped hunks after affected proof: the Agents API message-projection factory removal, its direct-constructor call sites, and corresponding test edits. Main's new instruction tests mock that factory, so the original factory and all main tests remain unchanged. The newly added prompt module now consumes the same official SDK tool type as the tool builder, fixing its stale import. The affected run exposed these two rebase interactions; the four-file correction is independently reviewed and published at99583705212ccea0231323a5ae11ee65eba4bfc6. The affected plugin batch passed on that correction; the remaining gates were interrupted when a further rebase became necessary.Landing rebase round 2: rebased onto
a46c0976ec7ac358b9b9a1249273a41cd287adfe. Kept main's Firecrawl config verbatim and the remaining equivalent error-payloadasOptionalRecordconversion, with its exact assertion baseline shrinking from 2 to 1. Dropped this branch's Firecrawl config type reorganization and the import/scrape-helper hunks already supplied by main. Main's tests are unchanged; the Agents API correction remains intact. Round 2 head:d5e2f6aaf25c7a93eac632a5ea97116c0d0542b4. Ontbx_01m3eefqj2d8g4fx9kgpxwk3f4, Firecrawl/ACPX/Agents API batches passed (538 tests, 47 files; 133.30 s), cross-shard consumers passed (183 tests; 34.41 s), check-changed passed (719.42 s), and build passed (493.48 s).Changed-test wall times, measured with
pnpm test <file> --maxWorkers=1(including wrapper/transform preparation):CI test-body seconds are sums of the reported cases for each file on head
1ca310da546; transform/worker preparation is excluded. Both hosted changed-plugin bundles passed in 309 s each, including provisioning and all their suites. The isolated wall times include wrapper/transform preparation.Hosted CI run
36231073038failed the filesystem import-boundary assertion in three Codex-plugin files outside this PR. A Linux Testbox A/B replay of the original 18-file shard on round 2 headd5e2f6aaf25c7a93eac632a5ea97116c0d0542b4and clean basea46c0976ec7ac358b9b9a1249273a41cd287adfeproduced identical outcomes: 271 passed, one failed, four skipped, and exactly the same three violating paths. The verifier compared the full selection, failed case, diagnostics, and counts. The owner repair is already merged asf2532a051f7a2c73731f7725184bff33b3b14f1f(fix(codex): use public SDK error helpers); it changes the imports and preserves error handling without expanding the allowlist. The proof lease is stopped.Landing rebase round 3 is published after rebasing onto main at
8fd72da7f2212ce86b77a36d95880b6a6eef8180, which contains that owner repair. Kept main's Agents API event-submission retry implementation and all Agents API tests unchanged. Dropped this PR's earlier single-event submission helper and its callers; kept only the independently reviewed official-SDK function declaration type reuse in that client. Range-diff confirms the other four commits are patch-identical. Published head:045cdcdee5b9e2fd7e33879cd188a977391ddf03(1,535 net runtime production lines removed). Affected gates passed on Blacksmith Testboxtbx_01m3ennj3bq01yjdvvwvzpz9y9(run):pnpm test:extensions:batch agentsapi onepassword(208 passed, one platform skip, 19 files; 52.52 s), the original filesystem-boundary shard on main's current tests (268 passed, four platform skips, 18 files; 20.14 s), cross-shard consumers (183 passed; 33.80 s),node scripts/check-changed.mjs --base 8fd72da7f2212ce86b77a36d95880b6a6eef8180 --timed(721.96 s), andpnpm build(457.88 s). The formerly failing boundary assertion passed, SDK exports/declarations built, and the tracked source remained unchanged throughout. The wrapper and proof both bound tree466f11f614059d5a22c3c67c0f2bba59d172da7fto the published candidate. Fresh exact-head hosted CI has started and is in progress. The owned proof lease is stopped. Auto-merge remains disabled for the coordinator handoff.