Skip to content

refactor(plugins): call existing operation owners directly - #176003

Merged
steipete merged 7 commits into
mainfrom
deslop/z19-62-extension-operation-owners-20261015
Oct 18, 2026
Merged

steipete merged 7 commits into
mainfrom
deslop/z19-62-extension-operation-owners-20261015

Conversation

@steipete

@steipete steipete commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Bundled plugin paths carry private test selectors, constant policy plumbing and forwarding layers around their only production operation owners.

User Impact

No intended user-visible change. Browser upload retention/quota and security checks, Copilot sandbox/tool authority and shutdown settlement, Matrix startup, Nextcloud guarded downloads and OpenShell filesystem behavior remain. Public SDK, config, CLI, protocol, dependencies and persisted shapes are unchanged. The Phase E standalone session-memory backend and its factory, registry, expiry, federation and tests are untouched; the small ordinary Memory Core index queue change is unrelated to that backend.

Why This Change Was Made

Call the existing operation owners directly. Browser recovery uses its existing fixed policy; tests exercise the actual limits. Copilot and Matrix fixtures intercept actual module boundaries instead of production operation selectors. Nextcloud calls the same guarded transport directly, and OpenShell constructs its sole filesystem bridge directly. Ordinary Memory Core index admission keeps the same local FIFO reader/writer queue without forwarding or repeated synchronous native-signal observations.

This is the extension-area slice of an86-path accumulation under the campaign's area-split rule, not a final residue or claim of exhaustion. Current rebased delta:25 paths, 104 net production lines removed, 188 test/support lines added, 84 lines added overall. Moved or test code is not credited as production reduction.

Fresh main had substantially reorganized Copilot's test fixture. The migration preserves its current helper functions, tables and assertions rather than replaying the older fixture. Module registration order, shared override identity, synchronous resolver results and owned teardown remain explicit.

Best-effort tradeoffs accepted

Evidence

Fresh25-root owning-graph semantic types passed27.326s; formatting passed0.433s and whitespace/index checks passed. Independent full25-path review completed scoped-clean through P2 (correctness0.89). Mandatory suppression policy passed14/14 in62.500s. Exact-path check-changed dry-run passed60.401s; this classified the required routes, not execution of its broad recommendations.

All existing production source preimages matched fresh main before composition. Copilot's evolved test was adapted from its exact current-main bytes with27 unique forward/reverse hunks; before formatting all467 assertion call expressions,18 tables and30 existing functions remained byte-identical. Its three related support/integration modules preserve leading registration imports and retrieve the same cached fixture exports without duplicate static value imports. These are source-transfer checks, not runtime proof.

The ordinary extension lint route requires package-wide declaration preparation, prohibited by the campaign's local build budget. Focused runtime has the same known cold-worker compiler prerequisite. Neither is claimed passing, no preparation/cache bypass was used, and no timeout/retry/skip/suppression was added. Current runtime, lint, architecture/SDK and build proof must come from exact-head hosted CI. No live provider/device or full build result is claimed.

Exact-head CI repairs

Run39089902105 at0f00a7ff6f8b049506eb507f53d64d9d9b4a9567 completed with four owned failures and its downstream gate. No inherited exception is requested:

Job Failure Repair
checks-node-changed-extensions-bundle-1 (117564485961) Copilot integration collection rejects exported vi.hoisted declaration Keep private hoisted binding and export an ordinary alias to the identical object.
checks-node-changed-extensions-bundle-2-2 (117564486151) Same Copilot attempt collection failure Same single fixture correction.
check-lint-extensions-1 (117565014847) Await of synchronous local index lease release Invoke that same release directly in finally.
check-lint-extensions-3 (117565014854) Shadowed mock binding, redundant conditional spread and unused mock-result local Rename only the local alias, pass the same conditional object directly and retain the identical mock chain without the unused local.
openclaw/ci-gate (117568459658) Downstream aggregate Requires repaired-head CI.

The actual installed Vitest transform rejects the exact original fixture and accepts its repair; that compiler-boundary control passed0.956s, not a runtime-case pass. Four-root semantic types passed36.453s, four-file formatting1.186s and whitespace checks passed. Fresh independent combined repair review completed scoped-clean throughP2 (correctness0.98). Existing assertions, tables, timeouts, cancellation and teardown remain unchanged. Repaired-head runtime and extension lint remain hosted proof gaps; the five cancelled auto-response jobs belong to separate auxiliary runs, not cancelled test suites.

Conflict-only integration

The repaired32a02 head completed exact-head CI39091778131 GREEN:119 check runs, no failed/cancelled/unfinished suites, aggregate gate117573929871 SUCCESS. GitHub later reported conflicts, so the branch was rebased onto main1446ecc; it was not updated merely to chase green.

Preserve current-main #176322's Nextcloud test consolidation, including the surviving matching/mismatching collision-renamed WebDAV identity table. The obsolete bot-tree negative removed by that change is not resurrected. Preserve current-main #175837's admitted Copilot harness wrapper, cancellation after host admission and explicit modelId. The seam migration uses the same module overrides and Date.now boundary without restoring removed production injection options.

Three conflict-file formatting passed1.930s and conflicted-graph semantic types passed171.772s. Focused three-file Vitest reached a cold worker-cache miss and attempted broad worker artifact preparation, prohibited by the campaign's local budget; only the owned compiler/managed runner were stopped and joined after213.703s. No cases completed, so this is incomplete local runtime proof, not a product failure or passing replay. Fresh full-area independent review completed scoped-clean throughP2/correctness0.96; mandatory suppression policy passed14/14 in75.809s; runtime cycle check passed with zero cycles in131.380s and static Madge cycle check passed with zero cycles. No timeout, retry, skip, suppression or preparation bypass was added.

Current-head hosted proof

Exact51bfc819badb4b37c9f464a7e93f8b4965dcfdd8 completed CI39161167966 GREEN, aggregate117778945685 SUCCESS. Full paginated117-check census has no failed/cancelled/unfinished suites; CodeQL aggregate is neutral, other conclusions success/skipped. Runtime, type, lint and PostgreSQL conformance jobs pass, and CI/dependency/security statuses are successful. No rerun, green-seeking source push or extra rebase was used. This hosted proof closes the broad runtime/lint gaps, not the incomplete local attempt or any live provider/device gap.

@clawsweeper

clawsweeper Bot commented Oct 18, 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.

@steipete
steipete marked this pull request as ready for review October 18, 2026 02:23
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 18, 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-18T20:01:49.103606Z 51bfc81 New commits
ℹ️ 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.

@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 18, 2026
@clawsweeper

clawsweeper Bot commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge.

What this changes

This PR replaces private operation overrides and forwarding layers with direct calls to existing bundled-plugin owners.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) Useful source-backed simplification with passing affected CI lanes, but the repeated fixture finding remains unresolved.
Proof confidence 🌊 off-meta tidepool Not applicable: This maintainer-authored refactor is outside the ordinary contributor proof gate; supplied evidence establishes source transfer and hosted owner-boundary tests, without claiming live plugin execution.
Patch quality 🦐 gold shrimp (3/6) 1 actionable review finding remain.

Product

Kind: Refactor · Worth it: Yes · Fix scope: Complete
User problem: No user-visible defect is claimed; private test controls and forwarding layers increase maintenance cost around existing plugin operations.
Reason: The maintainer-authored direction reduces production machinery while preserving public contracts and normal operation.

Merge readiness

⛔ Needs changes before merge - 1 item remains

Keep this PR open: the maintainer-approved simplification is useful, but the previously reported unused Copilot fixture remains.

Priority: P3
Reviewed head: 51bfc819badb4b37c9f464a7e93f8b4965dcfdd8

Before merge

  • Remove the unused duplicate tool-bridge fixture (P3) - This repeats the unresolved earlier finding. The new exported createStubToolBridge has no importer: attempt.test.ts still defines the identical local function, uses it for every call, and passes it to registerCopilotWorkspaceTests. The addition therefore creates unused duplicate scaffolding and a runtime SDK import, contrary to the applicable smallest-complete-fix policy. Remove this export and restore its supporting imports to their prior type-only form.

Findings

  • [P3] Remove the unused duplicate tool-bridge fixture — extensions/copilot/src/attempt.test-support.ts:194-198
Agent review details

How this fits together

Bundled plugin orchestration accepts browser uploads, agent attempts, channel startup and media requests, memory operations, and sandbox file operations, then delegates to their existing execution owners.

flowchart TD
Requests[Plugin requests] --> Orchestration[Bundled plugin orchestration]
Orchestration --> Owners[Existing operation owners]
Owners --> IO[Guarded transport and filesystem]
IO --> Results[Plugin results]
Tests[Test fixtures] --> Owners
Loading

Technical review

Best possible solution:

Keep the direct owner calls and remove the unused duplicate Copilot fixture and its supporting imports.

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

No product bug is claimed; source inspection directly confirms the unused duplicate fixture.

Is this the best way to solve the issue?

Using existing production owners is the smallest coherent refactor, provided the test migration also removes unnecessary duplicate scaffolding.

Full review comments:

  • [P3] Remove the unused duplicate tool-bridge fixture — extensions/copilot/src/attempt.test-support.ts:194-198
    This repeats the unresolved earlier finding. The new exported createStubToolBridge has no importer: attempt.test.ts still defines the identical local function, uses it for every call, and passes it to registerCopilotWorkspaceTests. The addition therefore creates unused duplicate scaffolding and a runtime SDK import, contrary to the applicable smallest-complete-fix policy. Remove this export and restore its supporting imports to their prior type-only form.
    Confidence: 1

Overall correctness: patch is correct
Overall confidence: 0.93

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Browser upload recovery and quotas keeps the original intent (151c549: Support remote-node uploads with bounded, private, recoverable staged files; the PR retains those production limits and checks.)
  • Copilot attempt operation selection keeps the original intent (299f5a4: Separate preparation and execution while retaining the attempt lifecycle; the removed selectors supplied test overrides around the same default owners.)
  • Matrix startup dependencies keeps the original intent (88d6556: Consolidate channel orchestration while retaining startup behavior; lazy loading and the selected operations remain intact.)
  • Memory generation admission changes intended behavior with a stated reason (b976624: Pre-count readers to accommodate synchronous release during admission; this PR explicitly accepts dropping exotic signal-object handling while retaining native cancellation and FIFO ordering.)
  • Nextcloud Talk guarded metadata requests keeps the original intent (2afa400: Authenticate inbound attachment identity through guarded requests; direct calls preserve credentials, origin restrictions, cancellation, response release, and identity checks.)
  • OpenShell mirror filesystem bridge keeps the original intent (dcb2065: Serialize complete file operations against mirror command publication; constructor substitution retains that lifecycle owner.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

Acceptance criteria:

  • pnpm test extensions/copilot/src/attempt.test.ts extensions/copilot/src/attempt-session.integration.test.ts
  • pnpm exec oxfmt --check extensions/copilot/src/attempt.test-support.ts
  • git diff --check

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit d77a03b adds extensions/copilot/src/attempt.ts:25 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: d77a03bbe12f; files: extensions/copilot/src/attempt.ts)
  • Vincent Koc: Raw commit 03b022b adds extensions/copilot/src/attempt.ts:180 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 03b022b88e75; files: extensions/copilot/src/attempt.ts)
  • Hoi Hin Adrian Ip: Raw commit a7766f1 adds extensions/memory-core/src/memory/manager-index-generation-lease.ts:189 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: a7766f1d273f; files: extensions/memory-core/src/memory/manager-index-generation-lease.ts)
  • lordratner: Raw commit 2afa400 adds extensions/nextcloud-talk/src/inbound-media.ts:421 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 2afa400a0de8; files: extensions/nextcloud-talk/src/inbound-media.ts)

PR surface

Source -104, Tests +188. Total +84 across 25 files. Added test files: 1.

View PR surface stats
Area Files Added Removed Net
Source 10 62 166 -104
Tests 15 332 144 +188
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 25 394 310 +84

Review metrics

Metric Value Why it matters
Production versus test/support LOC Production +62/-166; tests/support +332/-144 Production shrinks by using existing owners; fixture migration and cancellation coverage explain most test growth, except the unused duplicate identified below.

Labels

Label changes:

No label changes.

Label justifications:

  • P3: This is maintenance with no intended user-visible change; the remaining finding concerns unnecessary test scaffolding.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🌊 off-meta tidepool and patch quality is 🦐 gold shrimp.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

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.

History

Review history (2 earlier review cycles)
  • reviewed 2026-10-18T02:38:39.737Z sha 0f00a7f :: needs changes before merge. :: [P3] Remove the unused duplicate tool-bridge fixture
  • reviewed 2026-10-18T03:01:07.643Z sha 32a02c9 :: needs changes before merge. :: [P3] Remove the unused duplicate tool-bridge fixture

Reviewed October 18, 2026, 4:09 PM ET / 20:09 UTC (Revision 3).

@steipete

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@steipete
steipete force-pushed the deslop/z19-62-extension-operation-owners-20261015 branch from 32a02c9 to 51bfc81 Compare October 18, 2026 19:58
@steipete

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@steipete

Copy link
Copy Markdown
Contributor Author

Landing evidence for exact head 51bfc819badb4b37c9f464a7e93f8b4965dcfdd8.

CI run 39161167966 completed successfully. The refreshed full paginated exact-head check census contains 126 completed records, no failed/cancelled/unfinished suites, and successful aggregate 117778945685 and security-fast 117774939954. Runtime, type, lint and PostgreSQL conformance jobs pass. The CI, dependency-review and security-sensitive-review statuses are successful. Fresh live metadata reports MERGEABLE, with no submitted review or enforced review decision outstanding. No failing job is being waived or attributed to main.

The conflict-integrated 25-file candidate received a fresh independent review through P2 with no actionable findings. Conflicted-graph types, formatting, suppression policy and both cycle checks passed. The incomplete local runtime attempt remains disclosed in the PR; hosted exact-head CI supplies broad proof. The Phase E session-memory backend and all its machinery/tests remain untouched.

Native workflow infrastructure and authorized fallback

The campaign ledger records two earlier infrastructure interruptions of this native landing workflow: the extension initialization terminated with SIGTERM/143 (hhOkor), and the core baseline operation lost its session after completing the checkout phase (lCvZrx), leaving its exact owned lock. Both were reconciled through supported recovery; neither submitted a merge intent. The core PR subsequently completed native landing normally.

The current extension initialization was owner-interrupted after 669.020s without completing its retained checkout recovery; its Git working-tree check had not completed. This is not a product test failure or an automatic-deadline claim. Its exact owned process group was drained. The emitted exact-lock recovery completed successfully through the current origin/main native wrapper after a task-owned frozen tooling install supplied its required dependency version. The operation-lock ref is absent, and there is no accepted or uncertain extension merge request or merge-outcome ref to replay.

Under the operator's standing campaign Ending rule 10, use the direct squash endpoint with the exact head-SHA guard after recovery and fresh live head/check/security/review validation. This substitutes for the interrupted workflow, not any check or review. No CI rerun, green-seeking push, extra rebase, security waiver or unattributed-failure exception is involved.

Actual change: 104 net production lines removed, 188 test/support lines added, 84 lines added overall. The initial owned fixture/runtime/lint failures and their repairs remain individually recorded in the PR body; the current exact head is green.

@steipete
steipete merged commit fb33a9a into main Oct 18, 2026
129 checks passed
@steipete
steipete deleted the deslop/z19-62-extension-operation-owners-20261015 branch October 18, 2026 21:09
obviyus added a commit that referenced this pull request Oct 18, 2026
## What Problem This Solves

Fixes: Knip `deadcode:exports` on main reports four exports that recent refactors left without a consumer. #176447 does not cover them.

## User Impact

No user-visible change.

## Why This Change Was Made

- `src/cron/service.test-harness.ts: createCronServiceStateWithJobs`: #175975 removed its last callers, so it is deleted.
- `extensions/copilot/src/attempt.test-support.ts: createStubToolBridge`: #176003 added an exported copy that nothing imports, so it is deleted. The file is back to its state before #176003.
- `src/daemon/inspect-markers.ts: classifyGatewayCommand`: #176469 removed the only outside import, so it is now module-private.
- `src/gateway/server-cron.events.test-support.ts: CRON_WAIT_TIMEOUT_MS`: #176399 removed the last outside caller, so it is now module-private.

No ignores were added.

## Evidence

- `pnpm run deadcode:exports` on this branch, diffed against main `48439195832`: only these four entries disappear.
- `extensions/copilot/src/attempt.test.ts` and `src/daemon/inspect.test.ts` pass in full. `oxfmt` and `oxlint` are clean.

Co-authored-by: Ayaan Zaidi <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 19, 2026
…176003)

* refactor(browser): use fixed upload recovery policy

* refactor(memory): collapse local index lease acquisition

* refactor(matrix): use startup module owners directly

* refactor(openshell): construct the filesystem bridge directly

* refactor(nextcloud-talk): call the guarded fetch owner directly

* refactor(copilot): call attempt operation owners directly

* test: repair native extension seam fixtures
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 19, 2026
…6562)

## What Problem This Solves

Fixes: Knip `deadcode:exports` on main reports four exports that recent refactors left without a consumer. openclaw#176447 does not cover them.

## User Impact

No user-visible change.

## Why This Change Was Made

- `src/cron/service.test-harness.ts: createCronServiceStateWithJobs`: openclaw#175975 removed its last callers, so it is deleted.
- `extensions/copilot/src/attempt.test-support.ts: createStubToolBridge`: openclaw#176003 added an exported copy that nothing imports, so it is deleted. The file is back to its state before openclaw#176003.
- `src/daemon/inspect-markers.ts: classifyGatewayCommand`: openclaw#176469 removed the only outside import, so it is now module-private.
- `src/gateway/server-cron.events.test-support.ts: CRON_WAIT_TIMEOUT_MS`: openclaw#176399 removed the last outside caller, so it is now module-private.

No ignores were added.

## Evidence

- `pnpm run deadcode:exports` on this branch, diffed against main `7451c5780e5`: only these four entries disappear.
- `extensions/copilot/src/attempt.test.ts` and `src/daemon/inspect.test.ts` pass in full. `oxfmt` and `oxlint` are clean.

Co-authored-by: Ayaan Zaidi <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: matrix Channel integration: matrix channel: nextcloud-talk Channel integration: nextcloud-talk extensions: browser extensions: copilot extensions: memory-core Extension: memory-core extensions: openshell P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: L 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