Repository navigation
refactor(runtime): deslop private runtime exports - #164816
Conversation
Remove unused private SDK exports and their orphan helpers, types, and test-only implementations. Inline redundant target, logging, provider, and sandbox forwarding paths into their existing owners. Preserve public SDK and supported official-plugin contracts. Keep July 2026+ Matrix state formats while removing the pre-March raw-sync reader, and keep persisted cache keys unchanged. Independent Codex review completed with no P0/P1 findings.
|
🦞👀 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 October 4, 2026, 4:37 AM ET / 08:37 UTC (Revision 4). ClawSweeper reviewWhat this changesThe branch removes unused private runtime exports and helper layers, consolidates forwarding logic into existing owners, and simplifies Matrix sync-cache handling. Merge readiness⛔ Blocked before merge - 1 item remains Keep open as useful maintainer-authored cleanup. No actionable introduced defect was found, and the new pinned main/head comparison resolves the previous CI-attribution concern under the recorded inherited-failure exception. Priority: P3 Review scores
Verification
How this fits togetherPrivate runtime facades connect OpenClaw’s bundled plugins to host capabilities. This cleanup narrows those connections while preserving the owners that handle channel targets, sandbox operations, memory, and voice. flowchart TD
A[Bundled plugins] --> B[Private runtime facades]
B --> C[Existing host owners]
D[Configuration and saved state] --> C
C --> E[Channel and sandbox operations]
C --> F[Memory and voice behavior]
Before merge
Agent review detailsSecurityNone. PR surfacePR surface statistics unavailable: the file list is incomplete. Review metricsNone. Stored data modelPersistent data-model change detected: Technical reviewBest possible solution: Retain the smaller private facades and existing runtime owners while preserving supported plugin and saved-state contracts. Do we have a high-confidence way to reproduce the issue? Not applicable to this cleanup. The separate memory-forget CI failure has a pinned contributor-reported main/head comparison; this reviewer did not execute tests. Is this the best way to solve the issue? Yes. Removing unused private seams and inlining equivalent forwarding logic into existing owners follows the repository’s ownership model without adding parallel behavior. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 9c66d4c9a39b. 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
History |
Independent main/head reproductionThe memory-forget failure is independently reproduced on clean main. The PR head passes the same two files.
Both ran sequentially on the same Hetzner Linux x64 machine, using Node 24.19.0 and pnpm 12.5.1. Each revision had a separate fresh detached checkout and its own frozen dependency install; tracked source was verified clean. pnpm test extensions/memory-core/src/memory-forget-recovery.test.ts extensions/memory-core/src/memory-forget.worker-settlement.test.ts --maxWorkers=1This reproduces the ten cases in the failed hosted job. Its checkout log identifies merge The dynamic-consumer audit covered all 103 changed production files, including schema/table creators, worker and plugin registrations, manifests, glob/entrypoint generation, module initialization, and string/namespace consumers. It found no additional restoration candidate. The tombstone creator, worker binding, schema-admission owner, and Kysely write path are not removed by this PR. No schema change or restoration was made in this landing pass. Additional checks on the exact PR head passed on that lease: core and extension typechecks; 262 memory/database-schema tests across 13 files (two existing skips); Madge and runtime-value cycle checks, both zero. Earlier exact-source proof also passed 1,132 plugin-contract tests and both production/all-exports Knip scans. The leased push confirmed the published head was unchanged. The only failing non-aggregate hosted check is the memory-forget extension bundle; its CI gate failures are downstream. Security-sensitive and dependency review statuses are successful. Landing is authorized under the explicit proven-main-red, non-security exception, pinned to the API-observed PR head. The main failure remains a separate repair responsibility. |
Remove unused private SDK forwards and declarations, inline single-use runtime helpers, and preserve supported plugin and persisted-data contracts. Validated types, focused behavior, plugin contracts, Knip, memory/database schemas, and zero import cycles. Clean detached main reproduced the hosted memory-forget failures; the exact PR head passed all 12 corresponding tests. The maintainer-authorized main-red exception and full evidence are recorded in the PR. Main-red evidence: openclaw/openclaw#164816 (comment)
Remove unused private SDK forwards and declarations, inline single-use runtime helpers, and preserve supported plugin and persisted-data contracts. Validated types, focused behavior, plugin contracts, Knip, memory/database schemas, and zero import cycles. Clean detached main reproduced the hosted memory-forget failures; the exact PR head passed all 12 corresponding tests. The maintainer-authorized main-red exception and full evidence are recorded in the PR. Main-red evidence: openclaw#164816 (comment)
…ade exports were removed (#173777) * fix(plugin-sdk): published plugins fail to load after private SDK facade exports were removed Restore the runtime named exports that published external plugins import from JavaScript-only openclaw/plugin-sdk facades, which #164816 removed while the subpaths still ship. Each restored name is deprecated and tracked by the plugin-sdk-private-runtime-shipped-exports compat record (removeAfter 2027-01-15); a contract test keeps every recorded surface exported. Fixes #173386 * fix(plugin-sdk): include private runtime export record in PR wrapper inventory
…ade exports were removed (#173777) * fix(plugin-sdk): published plugins fail to load after private SDK facade exports were removed Restore the runtime named exports that published external plugins import from JavaScript-only openclaw/plugin-sdk facades, which #164816 removed while the subpaths still ship. Each restored name is deprecated and tracked by the plugin-sdk-private-runtime-shipped-exports compat record (removeAfter 2027-01-15); a contract test keeps every recorded surface exported. Fixes #173386 * fix(plugin-sdk): include private runtime export record in PR wrapper inventory (cherry picked from commit 970fc2f)
…ade exports were removed (#173777) * fix(plugin-sdk): published plugins fail to load after private SDK facade exports were removed Restore the runtime named exports that published external plugins import from JavaScript-only openclaw/plugin-sdk facades, which #164816 removed while the subpaths still ship. Each restored name is deprecated and tracked by the plugin-sdk-private-runtime-shipped-exports compat record (removeAfter 2027-01-15); a contract test keeps every recorded surface exported. Fixes #173386 * fix(plugin-sdk): include private runtime export record in PR wrapper inventory (cherry picked from commit 970fc2f)
…ade exports were removed (openclaw#173777) * fix(plugin-sdk): published plugins fail to load after private SDK facade exports were removed Restore the runtime named exports that published external plugins import from JavaScript-only openclaw/plugin-sdk facades, which openclaw#164816 removed while the subpaths still ship. Each restored name is deprecated and tracked by the plugin-sdk-private-runtime-shipped-exports compat record (removeAfter 2027-01-15); a contract test keeps every recorded surface exported. Fixes openclaw#173386 * fix(plugin-sdk): include private runtime export record in PR wrapper inventory
What Problem This Solves
Private runtime facades and unused helper layers retain code that no supported production path needs.
User Impact
No intended user-visible change. Config keys, CLI output, message formats, model-facing descriptions, public plugin SDK contracts, and July 2026+ persisted shapes remain supported. No migration or operator action is required.
Why This Change Was Made
This Knip-driven batch removes 1,015 net production lines (+187/−1,202), excluding tests, documentation, and qualification inventories.
wantsSave()implementation; remove only obsolete pre-March raw-sync migration support while retaining July's normalized saved-sync format.The normal production and all-exports Knip scans reported no unused exports on the starting base. A supplemental entry-export scan identified private facade candidates; each deletion then received consumer, manifest, documentation, and tagged-contract checks. Knip 6.32.2 does not expose a class-member issue category, so a separate method inventory was checked without deleting framework hooks.
Evidence
Independent Codex review of the full change and subsequent corrections completed with no P0/P1 findings. The rebase onto current main was patch-identical.
node scripts/run-vitest.mjs src/plugins/contracts --maxWorkers=1, 568.53s wall time).Validation used the authorized serialized
nice -n 15local fallback after remote admission and source-sync attempts could not reach a test payload. An oversized unchanged session-store selection and the optional broad local preflight were interrupted; their incomplete portions are not counted as passing proof.The changed tests add no cases or fixtures. Individual timing runs used
pnpm test <file> --maxWorkers=1; provider-catalog took 15.94s (11 tests), and the final embeddings partial-mock proof took 158.40s (15 tests, dominated by cold transformation). SDK-subpath inventory assertions passed in the full contract run above. Hosted CI timing is pending for the corrected head.The first hosted run exposed a stale assertion baseline (migration.ts: 7 < 8); the corrective commit shrinks it and fixes the embeddings mock to preserve real exports, removing its obsolete baseline entry. The affected test, assertion/SQLite/timeout/mock ratchets, and both cycle checks pass. That run also reported the ACPX owner-session fixture mismatch; main now contains its exact fixture correction in
d2a9f9a114c(its main workflow skipped test jobs, so this is source-fix evidence, not a passing hosted replay). The new exact-head run remains required.Independent Hetzner comparison now qualifies that memory-forget failure as inherited from main: clean detached main
a6b9da2failed the same ten cases, while exact PR head8a0cc249passed all twelve tests. Additional remote core/extension types, 262 memory/schema tests (two existing skips), and both cycle checks passed. The complete 103-file dynamic-consumer audit found no additional restoration candidate. No schema change was made. See the pinned reproduction and landing evidence. The explicit maintainer-authorized main-red exception applies; CI remains recorded as failed rather than green.