Repository navigation
refactor(core): deslop single-use core abstractions - #165124
Conversation
Inline internal single-consumer factories, policy adapters, projection helpers and forwarding modules into their concrete owners. Preserve public SDK seams, user-visible behavior, model context, and runtime ownership. Remove uncalled internal modes and keep boundary coverage on the retained flows.
|
🦞👀 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 October 4, 2026, 7:31 PM ET / 23:31 UTC (Revision 4). ClawSweeper reviewWhat this changesThe PR moves single-use model, conversation, approval, plugin, networking, usage, and update helpers into their existing owners and removes unused internal paths. Merge readiness✅ Ready for maintainer review The prior catalog-row typing blocker is resolved, and the introduced diff reveals no remaining actionable correctness or security findings. Current main retains the abstractions being removed, so this remains useful cleanup. Priority: P3 Review scores
Verification
How this fits togetherThese core components connect configured providers, plugins, and Gateway requests to model selection, conversation delivery, approvals, and update operations. The refactor consolidates their internal implementation while preserving the existing inputs and outputs. flowchart TD
A[Configuration and plugin metadata] --> C[Existing core owners]
B[Gateway and agent requests] --> C
C --> D[Model and tool selection]
C --> E[Conversation and approval handling]
C --> F[Usage and update operations]
D --> G[Existing public results]
E --> G
F --> G
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource -1009, Tests -91, Other -5. Total -1105 across 60 files. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Keep the consolidated implementation with its existing public contracts, lifecycle fences, and coverage at the surviving owners. Do we have a high-confidence way to reproduce the issue? Not applicable to the cleanup itself. The previously recorded declaration failure has a source-confirmed repair in the final commit; this read-only review did not execute it. Is this the best way to solve the issue? Yes. The diff removes private forwarding layers while retaining the existing SDK contracts, production policies, and state owners. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 382c987dbe1c. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (3 earlier review cycles)
|
Specialize private agent, Gateway, infrastructure, and plugin flows to their actual callers. Remove unused options, fixed-value forwarding, and unread result fields while preserving public SDK, configuration, protocol, and lifecycle contracts. Preserve the new commentary-media ownership hook during conflict integration. Net production reduction: 969 lines. Independent review was clean; focused owner tests passed and both import-cycle checks reported zero. Matching inherited main failures and exact-head CI evidence are recorded in PR #165198. Related prior batches: #164268, #164810, #165124.
Inline private single-consumer adapters into existing agent, Gateway, infrastructure, and plugin owners. Preserve public SDK, configuration, persistence, wire, and lifecycle/authority contracts. Remove 1,009 net production lines. Validate the final catalog-row projection with SDK declaration generation, focused registry tests, both import-cycle checks, and independent review.
Specialize private agent, Gateway, infrastructure, and plugin flows to their actual callers. Remove unused options, fixed-value forwarding, and unread result fields while preserving public SDK, configuration, protocol, and lifecycle contracts. Preserve the new commentary-media ownership hook during conflict integration. Net production reduction: 969 lines. Independent review was clean; focused owner tests passed and both import-cycle checks reported zero. Matching inherited main failures and exact-head CI evidence are recorded in PR openclaw#165198. Related prior batches: openclaw#164268, openclaw#164810, openclaw#165124.
What Problem This Solves
Single-consumer factories, forwarding modules, and parameter bags obscured existing core owners and added unnecessary code to maintain.
User Impact
No user-visible behavior change is intended. Public Plugin SDK contracts, configuration, persisted data, protocol responses, model-facing text, and lifecycle/authority checks remain unchanged.
Why This Change Was Made
This second pass after #164806 removes 1,009 net production lines in one batch, including nine private forwarding modules.
Existing behavior coverage is retained or moved to the surviving boundary. No timeouts, assertions, or fixture isolation were weakened.
Evidence
pnpm build:plugin-sdk:dts, focused lint, all 12 registry provider tests, and both cycle checks (0 cycles) on Blacksmith Testbox (run 37242540329). The source bytes were verified before execution and the lease is stopped.12fa4361d80faceb78d836f09f030edd3712e641passed hosted CI run 37243504484. GitHub completed the GraphQL squash auto-merge pinned withexpectedHeadOid; merge commit:dc518bfca481d64aef69f9a4f8435fc6d46ed46d. No admin exception was needed.node scripts/run-vitest.mjs src/plugins/document-extractors.runtime.test.ts --maxWorkers=1passed 13 tests in 17.40s wall time, including fresh worker preparation. No new test suites are added.