Skip to content

refactor(acp): collapse plugin-SDK entry points and redundant lazy shims - #120958

Merged
steipete merged 1 commit into
mainfrom
steipete/acp-sdk-surface-collapse
Aug 9, 2026
Merged

steipete merged 1 commit into
mainfrom
steipete/acp-sdk-surface-collapse

Conversation

@steipete

@steipete steipete commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

What Problem This Solves

The ACP plugin SDK accumulated overlapping runtime entrypoints and transparent *.runtime.ts shims. 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, with acp-runtime as 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/31297861905
  • node 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.

@openclaw-barnacle openclaw-barnacle Bot added size: M maintainer Maintainer-authored PR labels Aug 9, 2026
@steipete
steipete marked this pull request as ready for review August 9, 2026 06:33
@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. labels Aug 9, 2026
@clawsweeper

clawsweeper Bot commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 9, 2026, 2:39 AM ET / 06:39 UTC.

ClawSweeper review

What this changes

The PR moves ACP reply-dispatch implementation into one private SDK owner, retains released ACP compatibility facades, and removes redundant runtime shims.

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

Keep 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
Reviewed head: a742bb42067f8e62f55a228e754f3ed930e44ee6
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The compatibility-preserving, net-negative refactor has no supported correctness finding; remaining confidence depends on exact-head CI completion.
Proof confidence 🌊 off-meta tidepool Not applicable: This maintainer-authored internal refactor has no directly user-visible behavior change; focused automated validation is supplemental and exact-head CI remains the landing gate.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This maintainer-authored internal refactor has no directly user-visible behavior change; focused automated validation is supplemental and exact-head CI remains the landing gate.
Evidence reviewed 6 items SDK contract retained: The released ACP backend and binding subpaths remain in the SDK entrypoint inventory, so existing ACPX and Matrix imports retain supported resolution paths.
Canonical owner and compatibility facade: The PR relocates the former backend implementation into the private ACPX owner and leaves the old backend as a compatibility projection; the public ACP runtime projects reply dispatch from that same owner.
Lazy boundary remains intact: The ACP stateful-target driver is loaded dynamically by its builtins path, so moving the reset-service import inside that driver does not make non-ACP startup eager.
Findings None None.
Security None None.

How this fits together

The 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
Loading

Decision needed

Question Recommendation
Should this maintainer-owned ACP SDK refactor land once the remaining exact-head checks are green? Land after exact-head CI: Merge once required checks complete green because the released subpaths and lazy boundaries are preserved.

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

  • Resolve merge risk (P1) - Exact-head CI remains in progress; merge readiness should wait for those required checks to finish successfully.
Agent review details

Security

None.

PR surface

Source -56, Tests -3. Total -59 across 17 files.

View PR surface stats
Area Files Added Removed Net
Source 14 117 173 -56
Tests 3 5 8 -3
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 17 122 181 -59

Review metrics

Metric Value Why it matters
Production versus test delta production +115/-164 (net -49); tests +7/-17 (net -10) The cleanup is net-negative while keeping focused coverage aligned with the consolidated runtime seams.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Land the single-owner refactor after exact-head CI confirms the preserved SDK surface and lazy runtime topology.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best 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.

Labels

Label changes:

  • add P3: This is an internal SDK and lazy-loading cleanup with no claimed user-visible behavior change.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This maintainer-authored internal refactor has no directly user-visible behavior change; focused automated validation is supplemental and exact-head CI remains the landing gate.

Label justifications:

  • P3: This is an internal SDK and lazy-loading cleanup with no claimed user-visible behavior change.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This maintainer-authored internal refactor has no directly user-visible behavior change; focused automated validation is supplemental and exact-head CI remains the landing gate.

Evidence

What I checked:

  • SDK contract retained: The released ACP backend and binding subpaths remain in the SDK entrypoint inventory, so existing ACPX and Matrix imports retain supported resolution paths. (scripts/lib/plugin-sdk-entrypoints.json:124, 5f14d4631aa7)
  • Canonical owner and compatibility facade: The PR relocates the former backend implementation into the private ACPX owner and leaves the old backend as a compatibility projection; the public ACP runtime projects reply dispatch from that same owner. (src/plugin-sdk/acp-runtime-backend.ts:1, a742bb42067f)
  • Lazy boundary remains intact: The ACP stateful-target driver is loaded dynamically by its builtins path, so moving the reset-service import inside that driver does not make non-ACP startup eager. (src/channels/plugins/stateful-target-builtins.ts:9, 5f14d4631aa7)
  • Focused diff hygiene: The reviewed base-to-head diff is clean; it removes net production code while adjusting the associated test harnesses. (src/plugin-sdk/acpx.ts:1, a742bb42067f)
  • Recent area provenance: Recent history identifies the same contributor on the affected SDK and Matrix compatibility paths; deeper follow-history could not be completed because this partial checkout could not resolve its promisor remote. (src/plugin-sdk/acp-runtime.ts:34, 41a778d91a54)
  • Current-main comparison: Current main is beyond the PR base but does not already contain this PR head; the PR remains a distinct cleanup proposal. (src/plugin-sdk/acp-runtime.ts:34, 5f14d4631aa7)

Likely related people:

  • steipete: Authored the PR head and the most recent local history touch across the affected SDK and Matrix compatibility paths. (role: recent ACP SDK area contributor; confidence: high; commits: a742bb42067f, 41a778d91a54; files: src/plugin-sdk/acp-runtime.ts, src/plugin-sdk/acp-runtime-backend.ts, src/plugin-sdk/acpx.ts)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Wait for the remaining exact-head checks to finish green before landing.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@steipete
steipete merged commit 7af8e12 into main Aug 9, 2026
258 of 261 checks passed
@steipete
steipete deleted the steipete/acp-sdk-surface-collapse branch August 9, 2026 08:08
@steipete

steipete commented Aug 9, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: M status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant