Repository navigation
refactor(extensions): deslop memory-wiki, active-memory, acpx and agentsapi - #159262
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 27, 2026, 2:20 AM ET / 06:20 UTC (Revision 8). ClawSweeper reviewWhat this changesThe branch consolidates memory imports, recall, ACP session handling, and hosted agent-session code across four bundled plugins, and preserves literal Markdown links inside code examples. Merge readiness✅ Ready for maintainer review Keep open. Current main still uses the OKF line-based parser, and the branch contains useful work beyond the earlier merged plugin cleanup. The published-updater result requested in the prior review is now recorded; this review found no concrete introduced defect. Priority: P3 Review scores
Verification
How this fits togetherThese plugins read configuration, Wiki pages, and session state during OpenClaw agent turns. They produce searchable memory, ACP and hosted-agent results, outbound artifacts, and import rollback outcomes. flowchart LR
A[User turns and imports] --> B[Bundled plugins]
C[Configuration and saved state] --> B
B --> D{Parse and validate}
D --> E[Searchable memory]
D --> F[Agent sessions and tools]
E --> G[Replies and rollback results]
F --> G
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource -648, Tests +68, Docs +1, Other -1. Total -580 across 59 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Technical reviewBest possible solution: Keep the shared plugin owners and preserve existing state, launch, and final-authority contracts through the normal merge gates. Do we have a high-confidence way to reproduce the issue? Yes, from current-main source: the OKF line parser misses nested Markdown fences. The PR reports a real-importer regression failing before the repair and passing afterward; this read-only review did not execute it. Is this the best way to solve the issue? Yes. Reusing the existing Markdown code-range parser repairs the import path without adding another parser, and the refactor retains the inspected state and session boundaries. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 804376566a81. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (7 earlier review cycles)
|
fd40378 to
2d0e8d7
Compare
2d0e8d7 to
4aaf2bf
Compare
…ntsapi Consolidate wiki source rendering, retry handling, claim scoring and import projections; simplify Active Memory and agent adapter forwarding while preserving their persistence and protocol contracts. Fix OKF imports rewriting literal links inside nested Markdown code examples. The importer regression fails before the fix; full plugin and import-boundary suites pass on Linux Testbox.
4aaf2bf to
436ad42
Compare
…ntsapi (openclaw#159262) * refactor(extensions): deslop memory-wiki, active-memory, acpx and agentsapi Consolidate wiki source rendering, retry handling, claim scoring and import projections; simplify Active Memory and agent adapter forwarding while preserving their persistence and protocol contracts. Fix OKF imports rewriting literal links inside nested Markdown code examples. The importer regression fails before the fix; full plugin and import-boundary suites pass on Linux Testbox. * chore(extensions): shrink assertion baseline after deslop * refactor(memory-wiki): preserve allocation-safe map projections * refactor(agentsapi): simplify session receipt publication and settlement loop * refactor(agentsapi): retain explicit callback settlement guard
What Problem This Solves
Removes duplicated parsing, projections, and forwarding layers across Memory Wiki, Active Memory, ACPX, and Agents API.
User Impact
The refactor preserves memory/wiki persisted formats and SQLite behavior, ACP protocol behavior, Agents API wire contracts, plugin manifests, configuration keys, and tool registration order. OKF imports now preserve literal links inside nested Markdown code examples. No migration or operator action is required.
Why This Change Was Made
Production: 729 added / 1,377 deleted = 648 net lines removed. Tests: 68 net lines added; documentation: one line added. Fresh main already included earlier cleanup in #158532, contrary to the initial untouched-subtree inventory. The complete coverage log below records the remaining sound opportunities and retained contracts.
Fixes found along the way
OKF had its own line-based code-fence parser. It rewrote links inside blockquoted/list fences, indented blocks, and multiline code spans. The importer now shares the existing CommonMark code-range parser. The real importer regression failed on Linux before the fix and passes afterward. A separate single-import test protects label ordering and overlapping classification precedence.
Evidence
BELOW-THRESHOLD-PR-READY at
4174e78bd98c97b782c505c6513b73a9f18391ad, based onaad795bf312accc62015b533238d06c95f50c6a4. Exact-head GitHub CI succeeded: 64 jobs completed, no failures, both requiredopenclaw/ci-gatechecks successful. Independent Codex full-candidate and follow-up reviews completed through P2 with no accepted/actionable findings. The rebase preserved both main's isolated-completion owner and this branch's target validator.All execution below used Linux Blacksmith Testbox. All seven task leases are stopped; none remain active.
node scripts/check-changed.mjson final headpnpm test extensions/agentsapi/agentsapi-session.test.ts --maxWorkers=1on final headpnpm test:extensions:batch memory-wiki,acpx,agentsapipnpm test extensions/active-memorypnpm test src/infra/fs-safe-import-boundary.test.ts test/plugin-extension-import-boundary.test.ts test/test-helper-extension-import-boundary.test.ts test/scripts/extension-import-boundary-checker.test.tspnpm buildpnpm plugin-sdk:check-exportsandpnpm plugin-sdk:surface:checkpnpm plugin-sdk:api:diff -- --base aad795bf312accc62015b533238d06c95f50c6a4 --head 436ad42615b6087306732e26960da4b4095e2103--bundle-plugin acpx[email protected]updater into the candidateThe broad suite, build, SDK and upgrade proofs are pinned to
436ad42615b6087306732e26960da4b4095e2103. Final head differs only by restoring the original explicit loop-top guard inagentsapi-session.ts; there is no intervening await or side effect. That equivalent syntax was independently reviewed and validated by final-head changed checks, session tests and CI. The Wiki/ACPX/updater paths, dependencies and manifests used by the compatibility cell are byte-identical in final head.Published-driver existing-state compatibility
A task-owned runner reused the repository's upgrade-survivor implementation with isolated synthetic state. The installed published CLI performed
openclaw updateinto the exact packaged candidate; the candidate updater did not replace the driver under test.importRunsresults passed.wiki chatgpt rollbackrestored both original pages, preserved the operator-edited bytes in recovery, and repeated as a no-op with the same recovery paths.The SDK report is not empty: it reports 123 reachable-export hash differences from unchanged core declarations. Full JSON inspection across identical runs showed varying property order and inferred
readonly value?: undefinedoutput (three changed declarations versus two). SDK/core source, package, lockfile and compiler configuration inputs are identical between the compared base/head. No API baseline or suppression was changed.Validation corrections
The original OKF regression failed before the repair, then passed. Initial tooling attempts hit a changing source snapshot, unsupported Active Memory batch routing, and a missing exact Git commit object for API comparison; each was corrected at its owner. The first push stalled before publication; remote absence was verified before retrying with push negotiation.
Changed checks required the shrink-only assertion baseline update. Map-spread lint rejected several object-literal rewrites; the original map constructions were retained. Main's new Agents API code exceeded the line cap; a six-line receipt/settlement simplification fixes it without suppression. The explicit loop-top guard respects the callback-aware control flow and lint rules. An inherited UI lint failure was already owned and subsequently fixed in #159394, then incorporated by rebase. No test retries, skipped cases, weakened assertions or raised timeouts were introduced.
The temporary upgrade observer was corrected for private temp permissions, offline SQLite snapshots, SQLite row prototypes and the actual lazy ACPX lifecycle. One partial lease expired before rollback; its partial result was not counted as complete. The later uninterrupted cells passed the entire flow.
Lease and changed-test timing details
tbx_01m3fxp8dpsd5w71cakg7hyw83tbx_01m3g1fprre992eb5knmypv9x7tbx_01m3g3ze6m9g4g6wha6j7d8gh1tbx_01m3g8bjfaqah8j1461htzb567tbx_01m3gfgewzjt7hcf444bg01xj0tbx_01m3gjwexyh2tdzkccda89x6zttbx_01m3gp481hmj1z6pkh8t28btjyEach changed/new test file passed
pnpm test <file> --maxWorkers=1on Linux Testbox. Wall time includes startup and transformation. Hosted CI scheduled check/type/lint jobs rather than per-file Vitest runs, so runtime CI seconds are not available.extensions/agentsapi/agentsapi-attempt.instructions.test.tsextensions/agentsapi/agentsapi-files.test.tsextensions/agentsapi/agentsapi-messages.test.tsextensions/memory-wiki/index.test.tsextensions/memory-wiki/src/compiled-cache.integration.test.tsextensions/memory-wiki/src/okf.test.tsextensions/memory-wiki/src/prompt-section.test.tsextensions/memory-wiki/src/chatgpt-import-labels.test.tsCoverage log: every production file over 200 lines, sorted by size
Coverage uses the fresh starting revision
547bb312f4098cd0f28f71cc45a7e351e944b1ff; all production TypeScript/JavaScript files over 200 lines are listed in descending size. Smaller production files and plugin assets were also read. Fresh main already contained the earlier cleanup in #158532.extensions/memory-wiki/src/compile.tsextensions/memory-wiki/src/query.tsextensions/acpx/src/runtime.tsextensions/memory-wiki/src/chatgpt-import.tsextensions/acpx/src/codex-auth-bridge.tsextensions/memory-wiki/src/cli.tsextensions/agentsapi/agentsapi-session.tsextensions/agentsapi/agentsapi-messages.tsextensions/memory-wiki/src/okf.tsextensions/memory-wiki/src/compiled-cache.tsextensions/memory-wiki/src/markdown.tsextensions/agentsapi/agentsapi-attempt.tsextensions/agentsapi/agentsapi-tools.tsextensions/agentsapi/agentsapi-client.tsextensions/acpx/src/session-owner-migration.tsextensions/agentsapi/agentsapi-native-tool-projection.tsextensions/acpx/src/pi-session-store.tsextensions/active-memory/index.tsextensions/memory-wiki/src/lint.tsextensions/memory-wiki/src/source-sync-state.tsextensions/memory-wiki/src/import-runs-state.tsextensions/active-memory/recall.tsextensions/acpx/src/process-reaper.tsextensions/acpx/src/service.tsextensions/acpx/src/harness-attempt.tsextensions/memory-wiki/src/import-insights.tsextensions/active-memory/recall-run.tsextensions/memory-wiki/src/apply.tsextensions/active-memory/session-policy.tsextensions/acpx/src/runtime-session-store.tsextensions/active-memory/types.tsextensions/memory-wiki/src/gateway.tsextensions/memory-wiki/src/status.tsextensions/active-memory/config.tsextensions/active-memory/prompt.tsextensions/agentsapi/agentsapi-transcript.tsextensions/memory-wiki/doctor-contract-api.tsextensions/memory-wiki/src/bridge.tsextensions/acpx/src/codex-trust-config.tsextensions/memory-wiki/src/unsafe-local.tsextensions/active-memory/query.tsextensions/active-memory/recall-state.tsextensions/active-memory/session.tsextensions/memory-wiki/src/tool.tsextensions/active-memory/trigger-recall.tsextensions/active-memory/transcript-result.tsextensions/active-memory/transcript.tsextensions/acpx/src/pi-session-catalog-runtime.tsextensions/acpx/src/harness.tsextensions/memory-wiki/index.tsextensions/acpx/register.runtime.tsextensions/acpx/src/pi-session-catalog.tsextensions/acpx/doctor-contract-api.tsextensions/acpx/src/config.tsextensions/memory-wiki/src/config.tsextensions/memory-wiki/src/claim-health.tsextensions/agentsapi/agentsapi-files.tsextensions/acpx/src/runtime-generations.tsextensions/agentsapi/agentsapi-harness.tsextensions/memory-wiki/src/prompt-section.tsThe smaller production files and assets were also read. ACPX's public runtime barrel and packaged legacy MCP assets remain because their public/lazy-loading and manifest contracts are outside this cleanup's allowed cutover.