Skip to content

refactor(plugins): fold single-consumer plugin owners - #177170

Merged
steipete merged 2 commits into
mainfrom
deslop/z25-35-plugin-owners-20261015
Oct 19, 2026
Merged

steipete merged 2 commits into
mainfrom
deslop/z25-35-plugin-owners-20261015

Conversation

@steipete

@steipete steipete commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Six bundled plugins route registration, schema hooks and channel adapters through private modules with one production consumer. Tests also enter some private helpers rather than the registered plugin surface.

User Impact

No user-visible change. Plugin registration, model configuration, authentication and stream behavior remain unchanged; no migration or operator action is required.

Why This Change Was Made

Keep Geolocation Gateway registration at its plugin entry; Nextcloud configuration, pairing, Gateway and message adapters at the channel owner; ClawRouter schema hooks and pool registration at the entry; MiniMax provider registration and shared stream hooks at its entry; OpenRouter schema hooks at its entry; and Feishu chat/drive/permissions/wiki schemas at their existing operation owners. Remove thirteen private modules and narrow two Geolocation-only type exports. Seven existing suites now exercise the real registered owners, retaining their assertions. Feishu already tests the registered operations, so its tests remain unchanged; Drive keeps the private schema needed for its inferred parameters type.

Nextcloud's three moved config assertions are unnecessary with the existing structural types. ClawRouter's private schema normalizer declares its real object-preservation contract, removing its parameters assertion without runtime changes. Obsolete assertion and watch rows only shrink; no destination allowances increase.

This is the plugin-area slice of a materialized single-consumer family, now 93 distinct paths and 559 net production lines across four area branches, split under campaign rule 11 for CI attribution. Final formatted delta: 90 net production lines removed (+1183/-1273) across 24 production paths, 33 paths total. After the conflict rebase, tests add 20 net lines; metadata removes four. No public SDK, protocol, config or persisted-data change. Phase E is untouched.

Best-effort tradeoffs accepted

  • No security, authority, validation, durability, ordering, resource bound or failure guard is removed. All lazy OAuth/provider-auth/Gateway-error imports remain at their existing effect points.
  • MiniMax and Nextcloud had private module extractions for faster test collection (0828db9, 2de8b91, cc70e66). Owner-boundary proof can collect more of the real plugin graph; it no longer requires test-driven production export seams. Production eager/lazy dependency closures remain unchanged.
  • Existing schema normalization, catalog/cache scopes, current requester/config authority, secret-safe errors, account lifecycle, logout preservation, handoff receipts and HTTP ordering remain unchanged.

Evidence

Complete production owner/retired-helper inspection and migrated-test diff inspection completed. The author simplification pass retains only genuine shared private helpers; no replacement API, wrapper, cast, marker exemption or runtime validation was added. Installed TypeBox's structural schema contract and the pure config/pairing/message constructors were inspected. Whitespace and retired-reference checks pass.

Fresh independent P0–P2 reviews of both the initial candidate and the final Feishu/MiniMax increment completed scoped-clean with final source verification. The candidate was cleanly rebased onto main f551cc9371bcd24d6b942a92e81f80ee6a1eeff5; range-diff confirmed an identical patch. Frozen dependency refresh and canonical formatting completed. Targeted native types passed all 21 selected roots after repairing the MiniMax fold to retain the original separate readonly-snapshot and supplied-config base-URL reads, without a cast or public type change. All 22 focused files and 256 distinct cases passed, including the 14-case suppression suite. Five serial Vitest shards took 993.09 seconds under host load, predominantly transformation/collection; this is not a performance claim. Syntax lint passed for all changed plugin paths, script typed lint passed, and both runtime and Madge cycle checks found zero cycles. Whitespace checks passed.

Local typed plugin lint reported two error-type diagnostics for ProviderThinkingProfile and ProviderRuntimeModel, under both the core and targeted source-backed configs. Both plugins' nearest package-boundary configs resolve SDK imports to generated packages/plugin-sdk declarations, which are absent locally. No source types, suppressions or allowances were changed to hide those diagnostics. Passing source-backed native types supply the focused local type proof; exact-head CI owns package-boundary typed lint and built SDK proof. No local broad suite, build, E2E, whole-graph checker or operator-state access is claimed.

GitHub reported a real conflict after draft publication. The signed rebase onto main d01eb83 preserves main's MiniMax test consolidation from #177103, changing only its registration call to the real plugin entry. Range-diff confirms the production patch is unchanged. The affected two-root native typecheck, both MiniMax suites (34 cases), syntax lint and whitespace checks pass. Runtime and Madge cycle checks both find zero cycles. The earlier full test results above remain prior-head evidence. The focused suites took 383.06 seconds including cold cached-worker preparation; this is not a performance claim.

The post-rebase suppression ratchet found two existing typescript/unbound-method suppressions in ui/src/e2e/chat-managed-media-order.test-support.ts, a file this PR does not change. The ratchet and helper are unchanged from the rebased main baseline. One serial replay on fresh main 43e2d3c reproduced the exact 98-versus-97 failure and the identical extra helper row: 13 cases passed and one failed in 41.01 seconds. This local failure is inherited; the main violation remains unresolved. No allowance, suppression, skip or timeout was changed. The coordinator failure record and latest six completed schedules were checked; its older 98-versus-97 entry concerns different MCP/provider rows, so that entry is not being used as exact-signature proof. Exact-head hosted CI remains the broad gate.

Exact-head CI and native inherited-failure exception

Run 39234298826, attempt 1, tested head 89543e790208a3c7f169be3a10efe48415d5a520. All 216 check runs were enumerated. Extension typed lint, production/test types, package boundaries and independent security checks passed; this closes the local generated-SDK declaration gap above. Two cancelled administrative PR-context runs are superseded by successful same-head job 117999535143; no product suite is missing proof.

Failed job Attribution
checks-node-compact-small-8 (118000230089) Inherited: private UI server inventory expects 69, receives 68, missing desktop-resize.real-gateway.e2e.test.ts. Latest completed scheduled main 39232001367 at e87464759b58d376db0c7bd82dcf27addb0de84b has the identical assertion and missing row.
openclaw/ci-gate (118003505902) Downstream aggregate of that single failed leaf.

CI checked out merge e185addcadb4eee242132f80132ef58ebcb1d132, whose inspected ordered parents are protected main dd9272530e9ef2646f8551bbb5c1530d9af176c8 and this exact PR head. The inventory assertion, its AST helper, its Vitest inventory config and the desktop-resize source are byte-identical between the main parent and tested merge. The only tooling edit removes a retired MiniMax watch row, unrelated to private-server AST detection. The coordinator flake ledger and latest six completed scheduled main runs were checked; the new scheduled-main log supplies exact-signature reproduction, so no additional local replay was run. No CI rerun, allowance, suppression, skip, retry or timeout change was used. Landing requests the native authorized pre-existing-failure exception; failed CI is not represented as green.

@clawsweeper

clawsweeper Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added channel: nextcloud-talk Channel integration: nextcloud-talk scripts Repository scripts channel: feishu Channel integration: feishu extensions: minimax extensions: openrouter extensions: clawrouter Extension: clawrouter plugin: geolocation Geolocation plugin (IP to coarse city) size: XL labels Oct 19, 2026
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Oct 19, 2026
@clawsweeper

clawsweeper Bot commented Oct 19, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge.

What this changes

This PR folds single-consumer registration helpers, schemas, and adapters into their existing plugin owners.

Example: A ClawRouter request uses perplexity/sonar-pro with an object-valued tool parameter.

  • Before: The registered provider delegates schema normalization to a private module.
  • After: The registered provider performs the same normalization from its plugin entry.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The patch is coherent and source review found no introduced defect; available validation is reported in-process coverage, with production CI still unestablished.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored refactor is outside the ordinary contributor proof gate, and the diff introduces no material authority change.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Refactor · Worth it: Yes · Fix scope: Complete
Reason: The maintainer-directed change removes private forwarding seams and tests through registered owners while retaining existing behavior and public contracts.

Merge readiness

⛔ Needs changes before merge - 1 item remains

Keep open: this maintainer-directed refactor consolidates private plugin ownership without an identified correctness or security defect.

Priority: P3
Reviewed head: d13c1f9c404aa9f841d9980de2811400085c42c6

Before merge

  • Complete next step - Resolve GitHub's reported merge conflicts and mark this draft ready when the branch is ready for review.

Findings

None.

Tests

  • Missing end-to-end proof: No shipped-entry-point run is supplied; the PR explicitly limits its validation to focused tests and static checks.
Agent review details

How this fits together

Bundled plugin entries register provider hooks, Gateway methods, channel adapters, and agent tools with the host; these owners translate configuration and requests into provider or channel operations.

flowchart TD
  A[Plugin loader] --> B[Plugin entries]
  B --> C[Provider hooks]
  B --> D[Gateway methods]
  B --> E[Channel adapters]
  B --> F[Feishu operation tools]
  C --> G[Existing SDK and transport owners]
  D --> G
  E --> G
  F --> G
Loading

Technical review

Best possible solution:

Retain the consolidation into existing owners while preserving intervening main changes during conflict resolution.

Do we have a high-confidence way to reproduce the issue?

This PR proposes a behavior-preserving refactor rather than a bug reproduction; review used source and supplied evidence without executing target code.

Is this the best way to solve the issue?

The smallest complete change is to move each private single-consumer implementation into its existing owner, migrate its tests, and remove retired references; the patch follows that shape without adding replacement machinery.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against d01eb83804ae.

Provenance checked

  • MiniMax registration and Nextcloud adapter extraction changes intended behavior with a stated reason (0828db9: These private seams supported faster test collection, also documented by Nextcloud commits 2de8b91 and cc70e66; the PR explicitly accepts broader collection to test real owners.)
  • MiniMax M3.1 stream handling keeps the original intent (fix(minimax): honor M3.1 thinking effort levels #160089: Preserve mandatory adaptive thinking, selected effort, signed replay, and output caps on both provider hooks.)
  • ClawRouter pool and schema hooks keeps the original intent (feat(clawrouter): sidebar dashboard for subscription pool headroom #169514: Expose policy-scoped pool status without browser credentials; existing Perplexity schema compatibility and guarded request handling are relocated unchanged.)
  • OpenRouter Moonshot schemas keeps the original intent (fix(openrouter): prevent Kimi tool-schema rejection without losing alternatives #110138: Prevent proxy schema rejection without discarding valid argument alternatives or changing other model families.)
  • Feishu operation schemas keeps the original intent (2267d58: Plugin-owned operation schemas accumulated pagination, comment, and opaque-string wiki ID contracts; those contracts remain unchanged at their operation owners.)
  • Geolocation Gateway registration keeps the original intent (fe609d4: Provide authenticated bounded address lookups with current-requester checks; registration is moved without changing the lookup owner or authorization.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

PR surface

Source -90, Tests +16, Other -4. Total -78 across 33 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 24 1183 1273 -90
Tests 7 59 43 +16
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 2 0 4 -4
Total 33 1242 1320 -78

Labels

Label changes:

  • add P3: This is internal ownership cleanup with no intended user-visible behavior change.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • add status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Label justifications:

  • P3: This is internal ownership cleanup with no intended user-visible behavior change.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Rank-up moves

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

  • Obtain passing package-boundary type, lint, and runtime checks on the conflict-resolved head.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed October 19, 2026, 5:13 AM ET / 09:13 UTC.

@steipete
steipete force-pushed the deslop/z25-35-plugin-owners-20261015 branch from d13c1f9 to 89543e7 Compare October 19, 2026 09:58
@steipete
steipete marked this pull request as ready for review October 19, 2026 10:00
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-19T10:05:12.755848Z 89543e7 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@steipete
steipete merged commit 590d358 into main Oct 19, 2026
223 of 228 checks passed
@steipete
steipete deleted the deslop/z25-35-plugin-owners-20261015 branch October 19, 2026 10:41
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via explicitly authorized admin squash with attributed pre-existing CI failures.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 20, 2026
* refactor(plugins): fold private registration helpers into owners

* refactor(plugins): keep private schemas with operation owners
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: feishu Channel integration: feishu channel: nextcloud-talk Channel integration: nextcloud-talk extensions: clawrouter Extension: clawrouter extensions: minimax extensions: openrouter P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. plugin: geolocation Geolocation plugin (IP to coarse city) rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. scripts Repository scripts size: XL status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant