Repository navigation
refactor(acp): collapse plugin-SDK entry points and redundant lazy shims - #120958
Conversation
|
Codex review: needs maintainer review before merge. Reviewed August 9, 2026, 2:39 AM ET / 06:39 UTC. ClawSweeper reviewWhat this changesThe PR moves ACP reply-dispatch implementation into one private SDK owner, retains released ACP compatibility facades, and removes redundant runtime shims. Merge readinessKeep open: the refactor preserves the released ACP SDK subpaths and their lazy boundaries, with no concrete patch defect found. It is maintainer-owned and exact-head CI is still running, so it needs normal maintainer landing review rather than automated cleanup. Priority: P3 Review scores
Verification
How this fits togetherThe ACP plugin SDK connects plugin reply hooks to ACP-bound session delivery while keeping heavyweight runtime graphs lazy at startup. Its entry points are consumed by ACPX and Matrix plugin paths and route into reply dispatch, session metadata, and gateway reset behavior. flowchart LR
A[Plugin reply hook] --> B[Public ACP SDK]
B --> C[Released compatibility facades]
B --> D[Private ACPX owner]
D --> E[Lazy reply dispatch]
E --> F[ACP sessions and delivery]
G[Matrix and ACPX plugins] --> B
Decision needed
Why: The patch changes a public plugin-SDK implementation boundary while preserving its released facades; the maintainer label and in-progress exact-head CI require an explicit landing decision. Before merge
Agent review detailsSecurityNone. PR surfaceSource -56, Tests -3. Total -59 across 17 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Land the single-owner refactor after exact-head CI confirms the preserved SDK surface and lazy runtime topology. Do we have a high-confidence way to reproduce the issue? Not applicable: this PR refactors internal SDK ownership and lazy-loading seams rather than fixing a reported runtime failure. Is this the best way to solve the issue? Yes: one private implementation owner plus narrow released compatibility facades is the maintainable shape, and direct inspection found that the retained ACPX and Matrix paths still need those facades. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 5f14d4631aa7. LabelsLabel 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
|
|
Merged via squash.
|
What Problem This Solves
The ACP plugin SDK accumulated overlapping runtime entrypoints and transparent
*.runtime.tsshims. Some indirection no longer deferred any work, while collapsing every path outright would break separately published official plugins that shipped against the old subpaths.Why This Change Was Made
The startup-safe reply-dispatch implementation now has one private owner in
acpx.ts, withacp-runtimeas the canonical SDK projection. Released backend and binding subpaths remain narrow compatibility facades with a next-major removal plan; the Matrix binding-resolution facade intentionally stays narrow because its route path is statically loaded while lifecycle work is lazy.Three ineffective runtime shims were removed: ACP session metadata now rides the existing manager runtime load, TTS imports its canonical lazy runtime directly, and stateful target reset relies on the already-lazy ACP driver boundary. The manager and media facades remain because they still defer real heavy graphs.
User Impact
No user-visible behavior changes. Existing official plugins keep their shipped import paths, ACPX startup remains lazy, and the production diff removes 49 net lines while reducing redundant runtime modules.
AI-assisted implementation; the final patch was reviewed with the repository autoreview workflow and had no accepted/actionable findings.
Evidence
node scripts/run-vitest.mjs src/plugin-sdk/acp-runtime.test.ts src/auto-reply/reply/dispatch-acp.test.ts src/auto-reply/reply/dispatch-acp-delivery.test.ts src/auto-reply/reply/dispatch-from-config.acp-abort.test.ts src/auto-reply/reply/dispatch-from-config.reply-dispatch.test.ts src/auto-reply/reply/dispatch-from-config.stale-recovery.test.ts src/auto-reply/reply/dispatch-from-config.terminal-recovery.test.ts src/channels/plugins/acp-stateful-target-driver.test.ts— 208 tests passed.pnpm plugin-sdk:surface:check— passed at the existing 151-entrypoint / 4,844-export ratchets.pnpm check:import-cycles— 0 runtime value cycles.pnpm install --frozen-lockfile && pnpm build— passed on Blacksmith Testbox; all nine tsdown invocations completed with zero[INEFFECTIVE_DYNAMIC_IMPORT]warnings: https://github.com/openclaw/openclaw/actions/runs/31297861905node scripts/check-changed.mjs— all API/export/surface, dead-code, typecheck, lint, and architecture lanes passed: https://github.com/openclaw/openclaw/actions/runs/31298115532.agents/skills/autoreview/scripts/autoreview --mode uncommitted— clean; no accepted/actionable findings.