Skip to content

refactor(plugins): simplify transient cleanup bookkeeping - #174872

Merged
steipete merged 5 commits into
mainfrom
deslop/z06-5-update-context-20261015
Oct 17, 2026
Merged

steipete merged 5 commits into
mainfrom
deslop/z06-5-update-context-20261015

Conversation

@steipete

@steipete steipete commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Plugin lifecycle paths snapshot transient run context, classify identical cleanup errors twice, reread a just-published scheduler generation, and revalidate metadata already admitted by its current owner. These obscure the real execution-authority and shutdown-settlement boundaries.

Implementation

Keep one live transient run-context map, ordinary bounded cleanup, scheduler ownership and actual async-work drainage. Remove the private disposal-report classifier and its token brand. Consume metadata-owner admission, retaining requested workspace/index selection and the default-discovery boundary. Trust signed feed generatedAt only after the existing signature/payload parser; retain first expiry validation. Public SDK names/signatures, persisted shapes, security effects and Phase E standalone session memory are unchanged.

This is the plugin-area split of the preserved684-line candidate, per the campaign's widely-imported-owner split rule. Other areas are not in this PR. Net production: 187 lines removed,12 files,+132/-319 against9285ef2266ef9902c7126dc6c52d11de81a80686. Six test files, two shrink-only inventories and the orphaned prompt-recursion documentation correction complete this cut.

Best-effort tradeoffs accepted

Evidence

Current signed head186d143a8dad9398f2747690c327da995cf24e00 differs from reviewed fixture-repair90dcb001d88ba685eef6472ba987b5d57bcf063a only in docs/plugins/hooks/prompt-and-session.md: remove the obsolete nested-dispatch skip promise and state that recursive contributions are unsupported. Production remains exactly the187-line plugin-area cut. The complete original candidate remains on a preservation branch. Fresh independent area review completed with three findings, all personally source-disposed: metadata context is checked by the current owner before return; signed generatedAt is strictly validated by envelope decoding before typed return; unsupported same-runner recursion is the explicit tradeoff above. Not a scoped-clean verdict; no accepted actionable finding remains. The incremental fixture repair received a scoped-clean P0-P2 review. The documentation correction separately received a scoped-clean P0-P2 review, format and diff checks; retained handler lifetime, ordering and authority guidance is unchanged.

Public ClawHub consumer investigation completed29 verified keys, observed2026-10-17T05:54:33Z–06:20:05Z, latest eligible artifacts with no release-date filter. It found171 prompt-hook registrants,15 global runner references,1 harness getter and3 harness prompt-wrapper users, plus ordinary lifecycle/subscription registrations. These overlapping counts are not demonstrated affected-user counts. All traversals completed, but coverage is incomplete:2409 eligible artifacts,2029 complete scans,379 partial,1 failed,626 unresolved references; callback bodies and evidence snippets are bounded. Matched evidence does not demonstrate reliance on the three specific removed edge behaviors, and cannot exclude it. The compatibility decision is to proceed under the explicit best-effort tradeoffs above, not permission inferred from counts or a claim of no ecosystem impact. Local ordinary consumers, all public names/signatures, actual authority and settlement remain.

Canonical SDK declaration/closure comparison passed: No Plugin SDK API changes, digestff7b090f. Completed canonical9285 and90dc surfaces have identical SHA25674e1b4ffb3908fd0b3d6b6c023178994eefde1a8c442ca042e8f4defc7dd63f9. The documentation-only child186d changes no renderer input; a fresh canonical comparison/evidence explicitly records reuse of the actual90dc bytes for186d. It does not claim186d was rendered, and any declaration or closure drift would fail without acknowledgement. The original90dc wrapper subsequently exited0 after normal cleanup.

The old head's CI exposed an invalid negative fixture: activation-only config is intentionally default-discovery-compatible. The repair uses a custom plugin load path while keeping every cache identity and loader-work assertion. All32 metadata snapshot cases pass on90dc (799.98s Vitest,96%transform;907.88s complete wrapper with generation verification/cleanup). All3 mandatory suppression cases pass (165.91s wrapper). Targeted fixture lint and formatting pass. Lint initially stopped before analysis on a verified dead task-owned artifact lock, which was moved aside recoverably before the successful retry. Old-head architecture check117287020892 passed; the fixture-only repair changes no import edges.

Prior90dc CI run38997989422 is complete. Its latest census has188 terminal check rows,112 success/68 skipped/6 failure/1 neutral/1 superseded cancellation. This is prior-head evidence, not a pass for the documentation successor186d. The five substantive failed jobs are individually inherited, with matching assertions and determining-source evidence, not merely matching job names:

Failed job Exact failure Independent baseline evidence
Node large24-1,117295009617 Two retired physical owner Doctor:true cases797 expect versionless cursor but receive version2 Unrelated PR174857/run38995202196/job117286551620, identical test and cursor-owner blobs
UI1,117295009121 Four steering variants118 lack collapsed Advisor guidance notice Unrelated PR175019/run38998465758/job117296383789, all four exact assertions
UI4,117295009171 Publication-state495 lacks Dismiss pull request synthetic/publication-demo#44 Same peer/run, job117296383742, exact case and control
UI6,117295009173 Restart139 lacks System · restart recovery notice Same peer/run, job117296383779, exact case and locator
UI8,117295009181 PR193 expects openclaw/openclaw#103469, receives #103469; four viewport/theme variants329 lack dismiss control Same peer/run, job117296383826, all five exact assertions
Aggregate,117297181571 Downstream red from those five jobs No independent product failure

Our actual tested merge is97211bba2740f275128df4d6a755d2a382ec3195, parents main789c8c017d24f53030822ebc71ba46667bbabda5 and90dc. The independent UI peer tested mergedc8e7f36dfc3c713342c17bfdd7589f0289e8c82, parents main7d3a763f92e2febeeacd943597673600b4bb17c3 and46c6d6f08703c033a91fb24bada6565b4217e9c8. Its exhaustive six-path delta is Cron-only and disjoint from this PR. All12 plugin production files there retain the original pre-cut9285 blobs, including the deleted disposal classifier/token; all four failing tests and determining UI notice/PR owners/harnesses match our tested source. All11 exact UI failures therefore independently occur without this cut. This is inherited-failure evidence, not a successful baseline replay or a UI fix. Conservative build-prelude import overlap with the cleanup helper remains true; no blanket zero-import claim is made.

All applicable90dc security/quality/build/type/lint gates completed successfully; the earlier quota failures below are historical only. The186d push corrects a real orphaned documentation claim, not a green-only push or manual CI rerun. Current186d CI39008540735 is complete:184 terminal checks,118 success/62 skipped/2 failure/1 neutral/1 superseded metadata cancellation. All current hosted build/type/lint/architecture/security suites passed. Its sole substantive failure is independently inherited, established by the exact named assertion rather than job-name similarity:

Current non-passing check Attribution
checks-node-changed-compact-large-11 /117326170492 server-worker-placement-session-evidence.test.ts:306, warning-pipeline case expects unknown/receives absent. Full-file serial replay on the actual tested merge b467b5c82827c47ab356355acf53c6d16f767a20 reproduced it (11 passed/1 failed,761.77s); the actual main parent053cf12a7a0e4f603896569e7d9db1bfe4dd5fdc independently reproduced that same assertion without this cut (10 passed/2 failed,2487.81s). The additional baseline-only failure is the cold multi-agent case's unchanged120000ms timeout; it is disclosed, not used to classify the hosted assertion or claimed repaired.
openclaw/ci-gate /117327930835 Aggregate follows the single substantive hosted failure; CI remains red.
PR context and evidence /117325901372 Superseded cancellation; successful same-head successors117325957420 and117329147728 supply metadata proof.
CodeQL /117326237469 Neutral, not a failed analysis.

Both replays used the canonical gateway-database-workers config, the complete12-case file, one worker, identical qualified dependency manifests/test blob and separate isolated state. No case filter, retry, assertion weakening or timeout change. Conservative type-inclusive import reachability reaches all12 changed production paths; this is not a zero-import attribution. The independently matching actual-main assertion establishes inheritance. The conditional registry-read mock seam is a source-level lead, not a proven causal repair. Current exact-head native writer/policy/security verification passed separately against fresh main956d41049bb84d7a36192b32e3534646f1584533; security is not waived by the CI exception.

Historical old-head infrastructure failures: six Security High jobs completed analysis then failed SARIF upload on installationquota403; Critical Quality metadata selection matched unrelated38995632277/job117287449432. OpenGrep retained SARIF had0findings before upload403. These are not current-head failures and are not used to waive any missing gate.

Earlier timestamp boundary proof passed7 envelope cases and25 hosted cases, including the before-fix failing padded timestamp regression; those are prior-input results, not a blanket current-head pass. Earlier local cleanup/retirement failures remain investigated but unresolved: noSuccessor/noHeld scheduler cleanup expected1/received0, persistent-state cleanup, and explicit unavailable callback cases. Source tracing retained ordinary cleanup authority/settlement but did not establish a safe causal fix. No timeout, retry, skip or assertion was weakened. Hosted exact-head CI must decide this slice; any new changed-path CI failure follows serial attribution/import-closure withdrawal rules.

Landing uses the authorized inherited-only admin exception, with the exact-head SHA guard and a failure-table evidence comment. The campaign's Ending10 direct route is authorized after the recorded repeated native shared-ref/state-lease infrastructure failures; it bypasses that broken submission tooling, not review, source identity, security or failure attribution. Earlier local retirement failures and the extra baseline timeout remain explicit limitations, not passing tests. No timeout, assertion, retry or skip was weakened to qualify this change.

@clawsweeper

clawsweeper Bot commented Oct 17, 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 docs Improvements or additions to documentation scripts Repository scripts size: XL labels Oct 17, 2026
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. 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. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 17, 2026
@clawsweeper

clawsweeper Bot commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: stale review; fresh review needed.

Summary
The latest durable ClawSweeper review was for head 4076223204dc989b1a82f5ee5de91c834ff37ee5, but the PR head is now 90dcb001d88ba685eef6472ba987b5d57bcf063a. Its old verdict and PR readiness labels are no longer current.

Next step
Run or wait for a fresh ClawSweeper review on the current PR head.

Review history (1 earlier review cycle)
  • reviewed 2026-10-17T00:30:18.691Z sha 4076223 :: blocked before merge. :: none

@steipete
steipete force-pushed the deslop/z06-5-update-context-20261015 branch from 4076223 to 484aed0 Compare October 17, 2026 02:32
@steipete steipete changed the title refactor(infra): simplify update and plugin bookkeeping refactor(plugins): simplify transient cleanup bookkeeping Oct 17, 2026
@steipete
steipete marked this pull request as ready for review October 17, 2026 02:33
@openclaw-barnacle openclaw-barnacle Bot removed the docs Improvements or additions to documentation label Oct 17, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 17, 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-17T06:06:39.555395Z 186d143 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 removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Oct 17, 2026
@openclaw-barnacle openclaw-barnacle Bot added the docs Improvements or additions to documentation label Oct 17, 2026
@steipete

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Please review current head 186d143a8dad9398f2747690c327da995cf24e00. The plugin-area split, explicit best-effort tradeoffs, SDK comparison, consumer-coverage limitations and exact-head CI attribution are now recorded in the PR body. This requests review only, not repair or automerge.

@clawsweeper

clawsweeper Bot commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@steipete

Copy link
Copy Markdown
Contributor Author

Landing evidence for exact head 186d143a8dad9398f2747690c327da995cf24e00.

The complete submission-time paginated exact-head census has193 terminal rows:121 success,68 skipped,2 failure,1 neutral and1 superseded metadata cancellation. This includes the successful post-body-update metadata check117339672046. CI run 39008540735 remains red; it is not relabeled green.

Non-passing check Attribution
checks-node-changed-compact-large-11 /117326170492 Independently inherited: server-worker-placement-session-evidence.test.ts:306, warning-pipeline case expects unknown, receives absent. Actual tested merge b467b5c82827c47ab356355acf53c6d16f767a20 reproduced the exact assertion locally (11 passed/1 failed,761.77s). Actual main-parent053cf12a7a0e4f603896569e7d9db1bfe4dd5fdc independently reproduced the same assertion without this cut (10 passed/2 failed,2487.81s). Both complete12-case canonical replays settled exit1 after final generation verification/cleanup, with identical qualified dependency manifests/test blob and isolated state. Baseline's additional cold multi-agent120000ms timeout is a separate disclosed local limitation, not the hosted signature or a causal/fix claim.
openclaw/ci-gate /117327930835 Aggregate follows that substantive failure; no independent product failure.
PR context and evidence /117325901372 Superseded cancellation; successful same-head successor117325957420 supplies the metadata proof.
CodeQL /117326237469 Neutral, not a failed analysis.

Canonical SDK comparison completed: No Plugin SDK API changes, digest ff7b090f, strict any-change/no acknowledgement. Actual completed9285 and90dc surfaces have identical SHA256 74e1b4ffb3908fd0b3d6b6c023178994eefde1a8c442ca042e8f4defc7dd63f9. The documentation-only186d child changes no renderer input; fresh canonical evidence explicitly records bytes rendered at90dc and reused for186d, not a new186d render. Original render and cleanup completed exit0.

Independent whole-area review returned three findings, all source-disposed: metadata admission remains in its existing owner, signed timestamps remain validated at authenticated decoding, and unsupported self-recursive prompt dispatch is the explicit campaign tradeoff. Incremental fixture and documentation reviews were scoped-clean. Current exact-head hosted type/lint/architecture/security suites passed. Local metadata32/32 and suppressions3/3 passed on the production/test-identical90dc parent; earlier investigated retirement failures remain disclosed, not passing proof. Public consumer investigation is complete but coverage remains incomplete; the explicit campaign compatibility decision and named rare-edge tradeoffs remain in the PR body. Public signatures, effect authority, real shutdown settlement, durability and Phase E memory remain intact.

Current native policy verifies authoritative classic-protection absence, zero required approvals, sole required CI gate openclaw/ci-gate integration15368, and no outstanding formal review/thread. Writersteipete has verified active organization/repository admin authority. Current186d security verification and all13 protected-source identities passed against fresh main956d41049bb84d7a36192b32e3534646f1584533: protected publisher39009241707/attempt1/job117328019695, source9d7402370dccd7a612d6e706b5ffdb6e4e23e026, qualified guard statuses56583483563/56583484973. Combined status56583487044 is CI red, not security failure. The four determining placement test/resolver/inventory blobs remain identical to the independently executed main parent. Conservative type-inclusive reachability reaches all12 changed production files; inheritance is proved by the matching baseline assertion, not a zero-import claim. One advisory ClawSweeper re-review was requested after updating the body; it is not a landing gate. No new timeout, retry, skip or suppression.

Submission-time native revalidation again passed on fresh main8d4591a6c152cf28a095258f1aee6c2d0fcec65a: exact head186d is OPEN/ready/MERGEABLE; writersteipete remains repository/active organization admin; effective policy is unchanged; protected publisher/status and all13 current source blobs passed stable security verification. Formal reviews remain empty and no new substantive issue-comment finding is present. The956-to-8d delta has no production path in this lane or the PR, so no advancement-only rebase was performed.

Campaign Ending10 permits an exact-head guarded direct merge after the recorded repeated native infrastructure failures: two terminal shared-origin/main compare-and-swap failures and an independent native init OPENCLAW_STATE_LEASE_LOST before worktree entry. Their operations/locks were reconciled; no uncertain merge intent remains. This bypasses the broken submission tooling, not review, security, policy or failure attribution. The CI exception is inherited-only; CI remains explicitly red. Submission retains the exact186d SHA precondition and GitHub's atomic mergeability decision.

@steipete
steipete merged commit 0301614 into main Oct 17, 2026
192 of 196 checks passed
@steipete
steipete deleted the deslop/z06-5-update-context-20261015 branch October 17, 2026 07:21
steipete added a commit that referenced this pull request Oct 17, 2026
The worktree read-pool, plugin cleanup and Solid UI cutovers left 11
unused exports/types or imports that Knip could not follow. Keep live
read-operation maps in the same lazy parallel loader, make in-module
helpers private, and remove unused forwarding exports and metadata type.
Model the existing validator generator in the production Knip graph.

Production cleanup moved to clearPluginRunContext in #174872. Remove
its unused wrapper and exercise the owner directly; retain namespace
isolation and all four scheduler cases. Drop only callback-result
forwarding proof for that deleted wrapper. Live cleanup and handler maps
are unchanged. Keep the seven diagnostic test seams retained by #175223
and the staged MCP dependencies from #175254; do not add ignores.

Proof: 176 focused tests with --maxWorkers=1 passed in 434.17s; core,
UI, scripts and affected test type lanes, targeted type-aware/boundary
lint, formatting, and validator generation check passed. Production
findings drop from 18 to seven intentional test seams; three unrelated
full-tree test-support exports and staged dependencies remain.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 18, 2026
…74872)

* refactor(infra): simplify update and plugin context bookkeeping

* fix(plugins): retain default-discovery metadata admission

* refactor(plugins): split context cleanup from update bookkeeping

* test(plugins): use discovery-incompatible snapshot fixture

* docs(plugins): remove retired prompt recursion guarantee
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 18, 2026
The worktree read-pool, plugin cleanup and Solid UI cutovers left 11
unused exports/types or imports that Knip could not follow. Keep live
read-operation maps in the same lazy parallel loader, make in-module
helpers private, and remove unused forwarding exports and metadata type.
Model the existing validator generator in the production Knip graph.

Production cleanup moved to clearPluginRunContext in openclaw#174872. Remove
its unused wrapper and exercise the owner directly; retain namespace
isolation and all four scheduler cases. Drop only callback-result
forwarding proof for that deleted wrapper. Live cleanup and handler maps
are unchanged. Keep the seven diagnostic test seams retained by openclaw#175223
and the staged MCP dependencies from openclaw#175254; do not add ignores.

Proof: 176 focused tests with --maxWorkers=1 passed in 434.17s; core,
UI, scripts and affected test type lanes, targeted type-aware/boundary
lint, formatting, and validator generation check passed. Production
findings drop from 18 to seven intentional test seams; three unrelated
full-tree test-support exports and staged dependencies remain.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to documentation P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. scripts Repository scripts size: L

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant