Skip to content

refactor(sdk,state,skills): deslop plugin SDK internals, state and skills - #159299

Merged
steipete merged 4 commits into
mainfrom
deslop/l105-sdk-state-skills
Sep 27, 2026
Merged

steipete merged 4 commits into
mainfrom
deslop/l105-sdk-state-skills

Conversation

@steipete

@steipete steipete commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

SDK internals, shared-state helpers, and skill preparation repeat projections and ownership plumbing that can run through their existing owners.

User Impact

The refactoring preserves every public Plugin SDK entrypoint and type, SQLite schema and persistent-store policy, config key, and whole-skill serving contract. Small fixes found during the sweep settle channel cleanup correctly, release failed media readers, unblock cancelled login attempts, avoid unnecessary skill refreshes, and handle cyclic migration-report arrays.

Why This Change Was Made

Removes 694 net production lines after rebasing onto be43232aa6d6e1d9086380b1079f622e2cf52058. The initial candidate exceeded 1,000 lines, but #156541 landed overlapping state cleanup during validation. This PR retains those merged owners and drops duplicate work. The complete below-threshold coverage log is included below: every current production file over 200 lines, sorted by size, with its READ disposition.

Retained simplifications and rationale
  • SDK task adapters share scoped creation/mutation preparation while preserving synchronous and asynchronous authority checks. Persistent dedupe delegates option normalization to its persistence owner and uses the shared deferred primitive.
  • Provider tool-schema diagnostics share result projection and schema guards. OAuth uses the existing PKCE owner. Transcript identity projection and session normalization lose duplicate transformations.
  • Channel config descriptors, group-access results, access-group expansion, allowlist write-target selection, inbound dispatch, and bounded webhook maps lose repeated forwarding and projection code.
  • Bundled entries share runtime-setter construction without moving lazy loading earlier. Channel factories remove private already-guarded optional branches; deprecated Discord wrappers retain their exact public types without redundant assertions.
  • Skill loading and prompt preparation share capture/probe/retry machinery, preserving source-version, filter, and authority distinctions. Directory discovery reuses bounded traversal and diagnostic projection.
  • Skill config mutation edits the existing draft owner directly. Discovery/command selection, upload metadata reads, installer preflight, Workshop row projections, and runtime forwarding remove duplicate work. Upload base64 validation uses the canonical validator with the same accepted dialect.
  • Remaining state cleanup shares journal deletion and decoding, profile validation and ordered email selection, cleanup-error aggregation, lease observations, historical migration column projections, and worker-store filtering. Main's newly merged read-envelope and schema helpers remain canonical. No schema, transaction, retention, or publication-order change.

Fixes found along the way

  • Channel abort cleanup rejects its promise when a synchronous callback throws. HTTP task cleanup subscribes to close before an already-aborted signal can close the server synchronously, and retains cleanup rejection until settlement.
  • Hosted-media acquisition releases reader ownership when metadata lookup rejects, allowing deletion to reclaim the record.
  • An already-aborted provider-login reservation no longer remains in the active-login map.
  • Remote skill publication compares the retained display name when the optional label is omitted, so an identical catalog does not invalidate the snapshot.
  • Migration redaction detects array cycles while retaining repeated non-cyclic array output.
  • SDK API declaration rendering uses the native compiler's single-threaded mode to remove scheduling-dependent inferred declaration drift. Normal builds retain their parallelism; comparison remains strict, with no acknowledgement or baseline relaxation.

Evidence

Validated; hosted CI blocked by the inherited Windows PNG fixture at e5666405ac80ec94e485c9791b69f6fb341bc53b: 694 net production lines removed, with complete 228-file READ coverage below. The final rebase incorporates #159654's File Transfer boundary repair and commit e52420e1eea6c614ba7730d3d36980167478c6df's stale shared-worker admission repair. All three reviewed lane commits are patch-identical across this rebase.

Final-source proof passed on Blacksmith Testbox, provider blacksmith-testbox, lease tbx_01m3hrh829bnj7th66t0v7cw57, run. The wrapper verified source e5666405ac80ec94e485c9791b69f6fb341bc53b and its tree before execution; delegated checkouts use a synthetic carrier commit. The lease is stopped.

  • Strict current-base SDK comparison: no public API changes, 246.68 s.
  • Original five-group CI workload, with recorded concurrency: passed, 507.27 s. This same workload previously reproduced the migration lease-loss defect twice.
  • Affected worker/admission/lease/maintenance contracts: passed, 45.49 s.
  • Import-boundary siblings and SDK surface-budget tests: passed, 15.82 s.
  • pnpm build: passed, 379.51 s. The prior interrupted build was replaced by this complete result.

Final-head hosted CI is blocked by src/agents/tools/media-tool-file-url.windows.test.ts: its old PNG fixture has an invalid compressed-data checksum, exposed by the new decode validation in #159668. The Windows image read succeeds but decoding reports incorrect data check. Existing #159770 owns the canonical-fixture repair; this lane does not duplicate it or weaken the assertion. The dependency must land and hosted CI be refreshed before claiming READY-TO-LAND.

Retained proof for the unchanged reviewed patch:

  • Full node scripts/check-changed.mjs passed at bc859e65cefe (1,649.73 s); the scoped changed gate for the final state reconciliation passed at 63e95056492f with the exact upstream File Transfer fix (1,641.14 s).
  • Strict SDK comparisons at both preceding bases reported no public API changes, digest ff7b090f, without an acknowledgement or suppression.
  • node scripts/run-vitest.mjs src/plugin-sdk src/state src/skills: 6,170 tests passed across 519 files, with 25 tests / one file skipped, 621.65 s.
  • Import-boundary/surface tests, agent lifecycle/machine-state migration/Gateway skill update/Doctor Workshop callers, and pnpm test:extensions:batch irc,migrate-claude,openrouter passed. The original build passed in 381.18 s; it emitted only approximately 0.1 KiB soft UI gzip warnings, with hosted UI performance green.
  • pnpm test src/plugin-sdk/api-baseline.test.ts --maxWorkers=1: 20 consecutive Linux passes, all 28 tests each time. Fresh reconciled API/state/Doctor proof also passed in 110.03 s.
  • All five runtime bug controls failed on original source for the intended reason, then passed on the candidate. Fresh independent full-branch review after ownership reconciliation found no actionable P0–P2 findings; the final rebase preserves the reviewed patches exactly.

The inherited Agents API line-cap failure was fixed by #159262; the conversation database teardown race was fixed by #159445, so duplicate candidate repairs were dropped. The Codex startup-scan fixture race is fixed separately in #159664, with original failing proof, 21 whole-file passes and three exact shard replays.

The later migration failure was reproduced in the original five-group CI workload and again with receipt diagnostics: plugin lifecycle lease loss affected multiple matrix rows. Upstream e52420e1eea fixes the cause: inode-matched cached actors could retain invalid admission and reopen a retired path. The branch preserves that producer fix and its awaited fixture cleanup. It also carries #159654 rather than changing the filesystem-boundary scanner. One prior Testbox ended during build; that unfinished build is not counted as passing.

Changed-test measurements from the original-source/candidate proof on Linux Testbox (pnpm test <file> --maxWorkers=1, whole-command wall):

Test file Testbox command wall (s) Hosted test execution (s)
src/plugin-sdk/channel-lifecycle.test.ts 1.47 0.013
src/plugin-sdk/outbound-media.test.ts 15.38 0.871
src/plugin-sdk/provider-auth-login-flow-runtime.test.ts 14.83 0.025
src/skills/runtime/remote-skills.test.ts 14.70 0.186
src/plugin-sdk/migration-sensitive-redaction.test.ts 1.27 0.000
src/plugin-sdk/provider-oauth-runtime.test.ts 1.27 0.001
src/skills/lifecycle/upload-store.test.ts 22.93 8.598

Hosted times are sums of Vitest case durations in successful CI run 36314814265, exact head bc859e65cefe2f0c810902f6b0f531ee68204759. They exclude transform, collection, startup and file teardown; zero is reporter rounding. Per-file wall time was not retained by hosted CI.

Complete production coverage log (228 files over 200 lines)

l105 production coverage

Final coverage after rebasing onto be43232aa6d6e1d9086380b1079f622e2cf52058. Every current production file over 200 lines in src/plugin-sdk, src/state, and src/skills is listed below, sorted by current size. Test/test-support files are excluded; generated schemas and declarations are included and remain unchanged in this PR. All listed files were read by the lead or its subsystem reviewers.

Prior merged deslop patches and name-only diffs were inspected before implementation. During validation, #156541 landed overlapping state cleanup; the rebase retained those canonical owners and removed duplicate lane work. The final PR is therefore below the original line-reduction target despite the initial reviewed candidate exceeding 1,000 net production lines. New upstream async task and execution/heartbeat changes were read and preserved during the final rebase.

Lines Production file Status Applied simplification or reason to retain
2735 src/state/openclaw-state-schema.sql READ Read complete canonical SQL; schemas and persistent semantics are frozen by lane contract, so leave exact bytes unchanged.
1919 src/state/openclaw-state-db.generated.d.ts READ Read complete generated Kysely declarations; generated projection of the frozen schema is not hand-edited.
985 src/state/openclaw-agent-schema.sql READ unchanged canonical schema; lane freezes its bytes and persistent representation.
882 src/plugin-sdk/approval-native-helpers.ts READ Prior #158638 consolidation retained; remaining overloads, request filters, account binding and exact-target suppression preserve public approval/security contracts.
791 src/plugin-sdk/core.ts READ Lead removed inline pairing forwarder and prevalidated optional-adapter checks; preserve all entry contracts and lazy adapter behavior.
781 src/skills/security/scanner.ts READ Retained bounded heuristic scanning, alias provenance, comment/quote state, file identity cache and filesystem scan limits; recent sweeps already canonicalized rule and traversal owners.
768 src/state/openclaw-agent-db.ts READ unchanged since complete #159445 reread; preserve captured revocation diagnostics, runtime integrity handoff, registration witness and failed-close ownership.
768 src/skills/runtime/refresh.ts READ Retained: root promotion, callback reentrancy, retirement quarantine, capacity fallback, and shared subscriptions have different authority checks; combining them would obscure distinct lifecycle contracts.
756 src/plugin-sdk/approval-reaction-runtime.ts READ Prior #158638 consolidation retained; distinct reaction/manual rendering and target-store error/expiry policies are observable transport contracts.
751 src/state/openclaw-state-db-cache.ts READ Read main native removal-exclusion owner and maintenance-held WAL cancellation; preserve Gateway admission, exact native close custody and offline removal checks.
745 src/state/openclaw-state-db-async-lifecycle.ts READ Read main resource-claim admission and reentrant drainage cutover; preserve captured maintenance resource authority, per-database access and accepted-work settlement.
734 src/skills/lifecycle/install.ts READ Retained installer-specific bootstrap, privilege, package validation, platform PATH and policy flows; prior sweeps already shared validation and prerequisite helpers.
724 src/state/user-profile-list.ts READ Catalog leases, physical identity sharing, late mutation witnesses, and ordered publication fences each enforce an observed lifecycle contract; no sound additional simplification found.
724 src/plugin-sdk/provider-stream-shared.ts READ Retained: #158638 already consolidated payload/replay paths; remaining adapters preserve stream identity, terminal promotion, and shipped provider contracts.
719 src/state/openclaw-agent-db-lease.ts READ main retains its canonical lease-row readers; l105 additionally reuses the existing stale-owner predicate only in existing-schema maintenance drainage.
710 src/state/openclaw-state-db-readonly.ts READ Read main removal of coordinator pins/source-exclusion branches; retain snapshot preservation, native borrow and physical identity admission unchanged.
709 src/skills/loading/workspace-skill-loader.ts READ shared prompt/runtime asynchronous preparation loop; retained different filtering timing, runtime unfiltered inventory, explicit prompt-entry retry behavior, captured Library pins, and admission checks.
707 src/skills/loading/skill-root-discovery.ts READ shared bounded nested-root search and truncation diagnostics; retained root inclusion, symlink candidate detection, budgets, messages, and diagnostic fields.
700 src/plugin-sdk/qa-runner-runtime.ts READ READ whole module; manifest/runtime CLI reconciliation is canonical already; keep installed-plugin runtime-api fallback with named v2026.6.9 compatibility contract (recent #158638).
683 src/plugin-sdk/provider-onboard.ts READ Retained: #158638 already shares preset application; different merge, alias, explicit-replace, and credential-retirement rules are intentional.
681 src/state/openclaw-agent-execution.worker.ts READ full target reread; preserve canonical writeTransaction admission and command-specific receipts, relocated lifecycle errors, and the newly owned ACP session-entry operation/preparation path. No l105 change.
679 src/plugin-sdk/provider-auth-login-flow-runtime.ts READ Applied: prevent already-aborted reservations from keeping a conversation locked; regression exercises cancellation before/after reservation.
671 src/plugin-sdk/agent-harness-task-runtime.ts READ Applied: one creator parameter builder and one scoped mutation projector replace repeated incognito/ownership projection; sync/async authority order retained. Reread upstream #159325 during rebase: retained async nullable creation, async progress, and prepared recovery-reader contracts; reused the existing preparation for the new async methods.
666 src/state/openclaw-state-db-maintenance.ts READ Keep main moved ownership-error class and migration semantics; retain unique one-use repair-result wrapper inlining.
664 src/state/openclaw-state-read-worker.ts READ Preserve main user-preference capture/byte accounting and simplified worker context; retain unique identical structuredClone branch consolidation.
657 src/state/openclaw-database-preflight.ts READ Read main removal of retired source-exclusion branch; startup and maintenance schema inspection policies remain distinct.
657 src/plugin-sdk/session-transcript-runtime.ts READ Applied: target resolution now reuses the public identity projection; removed duplicate target projector while retaining transcript storage/lock/visibility semantics.
650 src/plugin-sdk/agent-harness-runtime.ts READ Applied: removed a one-use predicate/local and narrating ownership prose; all public facades and compatibility exports retained.
648 src/plugin-sdk/outbound-media.ts READ Fixed reader-reference leak when metadata acquisition rejects; retained per-store capacity serialization, chunk integrity, expiry and deletion policy.
648 src/plugin-sdk/channel-entry-contract.ts READ Shared optional companion-export loaders and runtime setter construction; lazy loading, registration order, guarded paths and public types preserved.
646 src/plugin-sdk/persistent-dedupe.ts READ Applied: canonical persistent owner normalizes captured options; shared deferred owner replaces hand-built promise; claim ordering, CAS, TTL, and memory fences retained.
641 src/state/openclaw-state-worker-runtime.ts READ Read main ACP mutation dispatch and backend-derived return type; preserve per-feature dispatch and existing ownership boundaries.
640 src/plugin-sdk/session-store-runtime.ts READ Retained: beta.5 compatibility bridges have explicit 2026-10-12 contract; projection wrappers enforce private-field and lifecycle boundaries.
635 src/plugin-sdk/api-baseline-declaration-closure.ts READ Retained: declaration traversal distinctions preserve ambient imports, cycles, fallback recall, and reachable-type hashing; no sound smaller owner found.
631 src/skills/runtime/remote.ts READ Retained: prior deslop already centralized probe failure/backoff; pairing generation and connection ownership must be rechecked across each await.
630 src/state/openclaw-agent-db-lifecycle.ts READ full target reread; #157413 removed pending-open coordinator preparation/deadline fields while retaining borrow pins, revocation, native drainage and integrity diagnostics. No l105 change.
629 src/state/user-model-accounts.ts READ Record codecs, owner checks, bounded inventory, exact credential replacement, and merge precedence have different persistent contracts; preserve them.
625 src/state/openclaw-agent-execution.ts READ full target reread; the first alias owns the executor maintenance resource, later aliases select cleanup outside maintenance admission, and borrowers observe the actual primary claim. Preserve idle-close recovery and revocation.
623 src/state/openclaw-state-lease.ts READ Read main removal of file-exclusion lifecycle and captured timer-renewal authority; take main verbatim and drop l105 aggregation for the deleted multi-owner drain.
617 src/state/openclaw-agent-db.generated.d.ts READ unchanged generated representation of the frozen schema; no hand edits.
617 src/skills/lifecycle/clawhub-install-core.ts READ Retained explicit-version versus server-resolved archive/GitHub trust paths and archive cleanup; merging these flows would alter their different provenance and policy contracts.
612 src/state/agent-deletion-journal.ts READ Retain the landed generated row type, direct transaction returns and path-update kernel. Unique changes reuse decoded existing rows, replace repeated field casts with the canonical record guard and share conditional deletion without changing predicates/publication.
607 src/state/openclaw-agent-db-schema.ts READ unchanged since complete #159445 reread; preserve runtime discovered-table integrity plan, sqlite_schema/shadow-table inclusion, transcript quick_check, and full-scan migration/maintenance defaults.
606 src/state/openclaw-state-db-legacy-backfills.ts READ Overlapping simplification landed in #156541; retain main implementation with no duplicate delta. Remove metadataStringField alias and call the existing textField owner directly.
599 src/state/openclaw-state-read.worker.ts READ Read main removal of coordinator context wrapper; canonical admitted-result envelope and per-command store owners remain unchanged.
594 src/state/openclaw-state-worker-owner.ts READ Reread complete at be43232: preserve e52420e original-admission validation before inode-matched actor reuse, joined idle retirement and active-callback refusal; main owns the lost-plugin-lease fix, with no l105 delta.
592 src/skills/workshop/apply-transition.ts READ Retained ordered evaluator/lease/filesystem/rollback/commit recovery boundaries; recent #158906 already removed redundant support-target checks and rollback wrapper.
590 src/plugin-sdk/provider-tools.ts READ Applied: common diagnostic projector for Gemini, DeepSeek, and llama.cpp; shared record predicates and one OpenAI null/default projection remove duplicate branches/casts.
588 src/plugin-sdk/reply-payload.ts READ Unified first/subsequent media and text send loops; caption placement, empty entries, result callbacks and final result preserved.
582 src/state/user-profiles.ts READ Reuse the canonical email selector and combine identical email-link publication/update tails, keeping previous-owner merge behavior and query order.
582 src/plugin-sdk/provider-entry.ts READ Retained: manifest auth, static/live catalogs, unreadable auth rows, and public option types have distinct validated contracts; avoid collapsing independent lazy paths.
575 src/state/openclaw-state-db.ts READ Read main cold admission and managed-transaction cutover; preserve retries only before callback entry, schema maintenance and committed-result permission handling.
572 src/state/openclaw-quarantine-store.ts READ Generation-bound quarantine and clean-close integrity receipts have distinct durability/error policies; retain frozen store semantics.
555 src/state/openclaw-agent-execution-native.ts READ prior full read plus target import-only diff; existing lifecycle error helpers now come from sqlite-lifecycle-errors, preserving first-cause and cleanup settlement semantics. No l105 change.
543 src/state/openclaw-state-lease-heartbeat.ts READ Read main physical-identity startup contract replacing coordinator retention; preserve startup handoff, renewal liveness and real lease deadline.
536 src/skills/workshop/store.ts READ Retained distinct record versus bundle read semantics, terminal-read lease avoidance, staged generation recovery, and visibility checks. Combining them would obscure meaningful ordering differences.
530 src/state/openclaw-agent-db-session-migrations.ts READ unchanged supported historical conversation/provenance/additive-column owners; named pre-October-1 migration contracts remain.
528 src/skills/lifecycle/clawhub-status.ts READ Retained status versus verification provenance checks and user-facing diagnostics; these deliberately compare different trust facts.
526 src/plugin-sdk/channel-config-helpers.ts READ Removed repeated descriptor projection chains, redundant return casts and second account normalization inside already-normalized CRUD callbacks.
513 src/plugin-sdk/runtime-doctor-migrations.ts READ Retained: immutable wildcard key moves and imported-key retention checks each own different repair semantics; no schema/recovery-policy change authorized.
512 src/state/user-profiles-internal.ts READ Retain the landed email-alias selector and private MIME helper. Keep the distinct ordered-email selector shared by listing, channel authority and avatar inspection; no duplicate alias owner.
511 src/state/openclaw-state-read.types.ts READ Overlapping simplification landed in #156541; retain main implementation with no duplicate delta. Factor common successful-read fields once while retaining every command payload and special optional admission result.
508 src/skills/runtime/refresh-content-native.ts READ Retained: namespace identity checks, admitted registrations, scan invalidation, and retained close failures protect different races.
504 src/plugin-sdk/provider-catalog-live-runtime.ts READ Retained: strict/optional discovery, anonymous fallback, and metadata/request credential lifetimes differ; no contract-neutral owner deletion identified.
499 src/state/user-profile-github-identity.ts READ The landed PR already owns the shared identity upsert, affected-ID list, no-op predicate and email-alias lookup. Keep the fresh-main file unchanged; no sound distinct simplification remains.
495 src/plugin-sdk/provider-catalog-live-normalize.internal.ts READ Retained: untrusted upstream row guards, unknown-model gate, modality checks, and trusted-origin projection protect distinct contracts.
495 src/plugin-sdk/api-baseline.ts READ Serialize native declaration emission after observed inferred-property drift; preserve strict API comparison and declaration reachability.
491 src/skills/lifecycle/clawhub-store.ts READ Retained strict, lenient and sync metadata readers plus legacy .clawdhub compatibility, authoritative publication and guarded rollback; persisted compatibility is a named contract.
490 src/plugin-sdk/approval-delivery-helpers.ts READ Flat shipped approval adapter and forwarding-routed adapter have different auth/suppression contracts; internal owner already shared by #158638.
490 src/plugin-sdk/api-diff.ts READ Retained: #158638 already deduplicated reachable declarations; parser validation and bounded reporting are independent required artifact boundaries.
486 src/plugin-sdk/status-helpers.ts READ Status projections retain omission/default contracts; no additional sound consolidation after recent #158638.
486 src/plugin-sdk/memory-host-core.ts READ Retained memory facade routes public-artifact discovery and host operations; preserve its public export inventory and host-owned lifecycles (recent #158638).
483 src/state/openclaw-state-lease-worker-owner.ts READ Read main removal of coordinator runtime from retained source checks; preserve original context, environment and live authority binding.
482 src/plugin-sdk/migration-runtime.ts READ Retained: target replacement journals, staged source checks, and recovery paths are durability contracts; no safe simplification of transaction state found.
471 src/plugin-sdk/qa-runtime.ts READ QA runtime facade contract is explicit and lazy; no independent duplicate implementation to remove after recent #158638.
461 src/plugin-sdk/allowlist-config-edit.ts READ Combined duplicate root-target branches, removed redundant single-key setter branch and callback wrappers; inheritance and canonical cleanup preserved.
458 src/skills/library/service.ts READ publication and mutation paths retain distinct current-authority checks around awaited filesystem/policy work and synchronous transaction admission; combining them would blur required sequencing.
449 src/skills/library/bundle.ts READ portable-path validation, manifest verification, and tree traversal protect distinct inputs; directory-sync behavior differs from the shared durability helper, so replacing it would change persistent-store semantics.
449 src/skills/discovery/status.ts READ status/readiness already share the requirements owner; preserve remote workspace facts, current binary probes, source provenance, and original install indices.
447 src/plugin-sdk/provider-catalog-live-acquisition.internal.ts READ Retained: #158638 already consolidated request acquisition; pagination deadlines, redirect credential stripping, and response bounds must remain independent.
446 src/state/openclaw-state-db-schema-repair.ts READ Overlapping simplification landed in #156541; retain main implementation with no duplicate delta. Use canonical SQL table extraction instead of duplicated marker parsing; exact DDL and diagnostic preserved.
442 src/state/openclaw-state-db-read-connection.ts READ Read canonical lifecycle-error import relocation; existing reader cleanup and snapshot contracts preserved.
441 src/state/user-channel-identities.ts READ Reuse the canonical ordered email selector. Policy fingerprints, grants and identity lifetimes remain distinct authority checks.
438 src/state/openclaw-state-worker-error.ts READ Closed error graph preserves shared/cyclic causes and descriptors while refusing unrelated object data; no safe shortcut.
435 src/state/openclaw-agent-worker-store.ts READ prior full read plus target import-only diff; l105 retains terminal cleanup aggregation through the canonical helper, but reconciliation must import both helpers from sqlite-lifecycle-errors.js.
430 src/plugin-sdk/windows-spawn.ts READ Windows executable/shim resolution and argument handling encode platform behavior; no behavior-identical structural reduction identified.
426 src/state/openclaw-agent-db-session-nodes-migration.ts READ target unchanged from prior base; l105 retains the canonical migrated-column selector and one scalar-owner precedence query for legacy entry/route projections.
424 src/plugin-sdk/channel-policy.ts READ One sender-access result projection instead of four duplicated result objects; decision order and sender matcher gating preserved.
422 src/skills/workshop/service.ts READ Retained revision and terminal-status flows with different draft, target, and rollback checks; recent #158906 already consolidated duplicated reads.
420 src/plugin-sdk/provider-model-shared.ts READ Retained: #158638 already simplified local selection; remaining public replay factories and lazy self-hosted registration have named contracts.
419 src/skills/lifecycle/workspace-skill-write.ts READ SIMPLIFIED: reuse the existing bounded hardlink/symlink-rejecting file reader for SKILL.md; preserve create/update commit and restoration ordering.
419 src/plugin-sdk/secret-ref-runtime.ts READ Secret-provider schema, setup, and resolution paths have distinct validation/credential responsibilities; no safe additional merge identified.
409 src/plugin-sdk/migration.ts READ Lead fixed active array-cycle redaction while preserving repeated-array rendering; no public type or store semantics changed.
408 src/plugin-sdk/infra-runtime.ts READ READ whole module; explicit compatibility export inventory is deliberately pinned, and detectErrorKind preserves shipped substring semantics.
407 src/plugin-sdk/session-visibility.ts READ Applied: remove unnecessary config cast and delegate sandbox clamp default to canonical resolver; retain linear wildcard algorithm and live grant checks.
405 src/state/openclaw-state-db-schema-additive.ts READ First-use table creation, lazy columns and historical repair are distinct persisted contracts; schema changes forbidden.
398 src/state/openclaw-agent-db-validation-cache.ts READ unchanged since complete #159445 reread; proof revocation, canonicalReady fencing, and persisted canonical receipts retain distinct integrity responsibilities.
398 src/plugin-sdk/qa-channel-protocol.ts READ READ whole module; QA type contracts and bounded redaction are canonical; retain target grammar and strict caps, possible cast-only cleanup is minor.
396 src/skills/lifecycle/upload-store.ts READ SIMPLIFIED: replace hand-written base64 alphabet/padding validation with the canonical media-core attachment validator; retain trimmed outer whitespace, nonzero pad bits, size checks, upload locks and lease custody.
395 src/plugin-sdk/webhook-request-guards.ts READ Prior #158638 error projection retained; pre-auth limits, rejection settlement and detached-work ownership need distinct paths.
394 src/state/openclaw-agent-db-admission.ts READ full target reread; #157413 removed coordinator acquisition, lifecycle deadlines/notices and transport, while preserving caller AbortSignal checks, last-waiter cancellation, physical generator custody and live-authority checks after integrity awaits.
391 src/skills/loading/plugin-skills.ts READ retained plugin publication memo lifecycle, ACP availability, Windows junction handling, and hardlink provenance; these are distinct operational contracts, not removable forwarding.
387 src/state/openclaw-state-db-table-retirements.ts READ Supported historical retirement requires exact schema, dependency and cursor checks; retain shipped migration contracts.
385 src/skills/runtime/resources.ts READ Applied: reuse the already resolved explicit-selection fact for model visibility instead of repeating selection lookup. Bundle byte limits, immutable pins, host readers, and live authority checks remain unchanged.
384 src/plugin-sdk/provider-auth.ts READ Retained: deprecated Copilot helper remains public; credential/domain-scoped cache and timeout/error mapping preserve shipped semantics.
379 src/plugin-sdk/session-visibility-internal.ts READ Applied: reuse actionPrefix for lookup-denial and operation-failure messages; policy evidence and ownership failures unchanged.
378 src/skills/runtime/workspace-worker.ts READ Retained: native operation request types differ; replacing per-operation casts with a broad context or generic dispatcher would weaken the same-version IPC contracts.
376 src/state/agent-database-admission.ts READ Startup/diagnostic precedence, preparation scope guards and exact refusal object identity protect independently concurrent owners; retain.
373 src/state/agent-database-startup.ts READ File witnesses, activation custody, ordered preparation and joined shutdown protect separate lifecycle boundaries; retain.
372 src/skills/workshop/service-evaluation.ts READ Retained plugin-output normalization and evaluator admission/revalidation; these protect untrusted plugin results and revision/target drift. Its storage kernel now uses the canonical validated-row reader.
370 src/skills/workshop/service-propose.ts READ Retained create/update distinctions and pre-await snapshots. A generic request-preparation object would add an abstraction without removing a responsibility.
368 src/skills/library/store.ts READ narrow query/authority/projection functions have live callers; schema-admission migration would require a separate ownership change rather than behavior-neutral cleanup.
367 src/state/openclaw-state-worker-contract.ts READ Read main ACP mutation operation addition and obsolete lifecycle option removal; preserve the canonical backend type composition.
367 src/skills/loading/workspace-skill-sync.runtime.ts READ retained manifest/source identity, destination reuse, copy cleanup and pinned Library reads; previous sweep already removed duplicate file and queue helpers.
361 src/state/openclaw-agent-db.paths.ts READ unchanged Unicode case/normalization, missing suffix, hard-link, raw symlink-walk and import-boundary contracts.
357 src/plugin-sdk/channel-ingress-runtime.ts READ Public released resolver authority and durable fan-in settlement differ intentionally; adoption-order/error handling and source cancellation capability cannot be collapsed.
356 src/plugin-sdk/webhook-targets.ts READ Prior #158638 consolidation retained; synchronous and asynchronous public matchers preserve early ambiguity exit and registry teardown ownership.
354 src/plugin-sdk/discord.ts READ READ whole module; compatibility API/runtime facades must remain lazy and preserve argument types; suggested removing 3 redundant identical function assertions.
351 src/state/user-profiles-avatar.ts READ Reread all 351 lines after #157413. Keep the landed removal of requireStateLifecycle; the worker operation contract retired that option with the coordinator cutover. Current physical-identity admission, before-row validation, retained settlement publication, cache bounds and stale-byte checks remain intact. Our shared row validator preserves the same predicate and our ordered-email selector preserves inspection results; no conflicting cleanup or additional sound change found.
351 src/plugin-sdk/provider-auth-claude-compat.ts READ Applied: reuse canonical optional-string normalization for credential/account metadata; retained documented Claude source-compatibility windows and keychain selectors.
349 src/state/openclaw-state-db-repair.ts READ Read main Doctor admission-before-permissions change; ownership refusal and schema repair stay with current maintenance owner.
347 src/state/openclaw-agent-db-readonly-scope.ts READ unchanged caller/cached reader ownership, transaction fallback, borrower pins and failed-close custody.
346 src/state/openclaw-agent-db-registry-listing.ts READ full target reread; captured async scope and registry invalidation witnesses remain, while the retired coordinator-runtime directory wrapper is gone. Existing main clone/filter cleanup is not l105 work.
344 src/state/user-profile-events.ts READ One publication kernel owns transaction staging and revision-map updates for profile, identity and channel changes; each keeps its existing revision domain.
342 src/state/openclaw-state-db-audit-migration.ts READ Legacy/current column arrays and exact SQL preserve supported audit cursor migrations; retain frozen migration contract.
342 src/skills/library/selection.ts READ synchronous SDK loading and asynchronous worker preparation share materialization/cache publication but retain different snapshot/authority timing; preserve their boundaries and immutable-pin behavior.
341 src/state/user-github-connections.ts READ Use the existing listener-registration owner. Persistent OAuth selection, replacement and refresh contracts remain intact.
337 src/plugin-sdk/provider-catalog-shared.ts READ Retained: cache replacement identity and completion-relative TTL are observable; configured-row normalization preserves malformed input handling.
331 src/state/openclaw-agent-db-schema-helpers.ts READ unchanged canonical migration-column selector and schema/compatibility owner; l105 node/window migration consumes its existing selector.
325 src/skills/runtime/refresh-state.ts READ Applied: remove a narrating header. Shared/scoped discovery versions and supporting-file versions have intentionally separate invalidation semantics.
323 src/state/openclaw-state-worker-error-identity.ts READ Read main error-owner relocation and Gateway state-owner contention envelope; preserve new runtime class identity and payload parsing.
323 src/skills/lifecycle/clawhub-uninstall.ts READ Retained file fingerprints, tracked publisher identity, staging ownership and guarded rollback; each awaited mutation rechecks its live authority.
322 src/skills/lifecycle/install-download.ts READ Retained pinned download destination, decoded byte limit, checksum, archive staging and safe publication; error outputs intentionally differ from command install normalization.
322 src/plugin-sdk/channel-inbound.ts READ Mostly pinned public exports, released aliases and overload wrappers; removing generic defaults/overloads or compatibility translation would change API.
322 src/plugin-sdk/api-baseline-declaration-print.ts READ Retained: distinct native compiler AST factory signatures require their corresponding declarations; inferred return types and tuple order are baseline contracts.
321 src/plugin-sdk/provider-auth-runtime.ts READ Retained: loopback/CORS behavior, lazy built/source module search, cancellation fences, and runtime auth fallback require packaging/compatibility coverage.
318 src/skills/loading/session.ts READ merged metadata validators at their sole reader while preserving description-before-name diagnostics; retained active public SDK session loader and its distinct ignore/source/path behavior.
317 src/skills/lifecycle/clawhub.ts READ SIMPLIFIED: expected and downloaded integrity routes share owner preflight and trust-warning projection without changing archive cleanup ordering.
311 src/skills/workshop/experience-review.ts READ Retained source-session, permission, runtime-mode, admission, and outcome-publication checks across async work.
306 src/state/openclaw-database-verify.impl.ts READ Exit plus IPC disconnect settlement, generation revalidation and quarantine publication are required separate phases.
303 src/state/user-channel-identity-operations.ts READ Read retry, exact mutation admission and settlement fences differ by authority kind; consolidating them would invent policy plumbing without simplifying the owner.
303 src/plugin-sdk/facade-loader.ts READ Managed-proxy reflection, owner-generation checks, module cache, hardlink gates, and lazy loading have separate invariants; local path helper differs from shared Windows semantics.
302 src/state/session-repository-workspaces.ts READ Existing mutate already owns revision checks, current authority, write and publication; creation/deletion retain their different artifact lifecycle.
302 src/skills/lifecycle/archive-install.ts READ Retained local/remote file-owner dispatch, policy checks, exact replacement guards and root-marker/failure classification.
302 src/plugin-sdk/file-lock.ts READ READ whole module; fs-safe is already canonical owner after #158638; wrapper preserves stale-owner policy, release guards, and aggregate-error settlement.
300 src/skills/lifecycle/upload-store.kernel.ts READ Retained expiry/idempotency/offset/capacity checks and native lease transactions; pre-read and transaction reread cover different races.
295 src/state/openclaw-state-worker-lease.ts READ Preserve main captured maintenance-resource authority through commands and acquisition; retain equivalent cleanup aggregations via sqlite-lifecycle-errors.
295 src/skills/runtime/refresh-watch-path.ts READ Applied: combine identical directory/symlink/absent-stat branches and return polling/discovery classification directly; normalize string/Buffer event names through one result branch.
294 src/state/user-profile-identity.read.ts READ The landed PR already reuses toUserProfile through Object.assign and the canonical email-alias selector. Keep the fresh-main file unchanged; alias/prefix/damaged-key boundaries remain distinct.
294 src/plugin-sdk/pair-loop-guard-runtime.ts READ Pair-loop scope and outcome tracking encode delivery behavior; no independent duplicate owner suitable for removal identified.
290 src/state/openclaw-agent-db-legacy-schema.ts READ target unchanged from prior base; l105 retains one ordered destination/expression projection instead of paired column lists, preserving historical defaults and insertion order.
288 src/state/openclaw-state-db-startup-checkpoint.ts READ Read complete current module: ordinary checkpoint reads acquire schema ownership only when bootstrap/additive repair is needed; preserve callback atomicity and integrity rereads.
288 src/plugin-sdk/channel-outbound.ts READ Mostly pinned public exports and deliberately lazy durable-send import adapters; stale-install no-send classification and render compatibility are named contracts.
285 src/state/openclaw-state.worker.ts READ Lazy feature runtimes must prepare asynchronously before synchronous execution; no pass-through runtime path is removable.
284 src/skills/lifecycle/workspace-types.ts READ Retained shared file-host lifecycle and public SDK contract types unchanged.
283 src/skills/workshop/tool-policy-diagnostic.ts READ Retained real effective-policy composition and ownership-specific remediation paths; the branches represent different config owners.
282 src/plugin-sdk/provider-selection-runtime.ts READ Retained: explicit selection and ordered auto-selection intentionally have different availability/config outcomes; config alias precedence remains canonical.
279 src/plugin-sdk/provider-oauth-runtime.ts READ Applied: reuse canonical PKCE generator and native base64url state encoding; extended existing test to assert RFC SHA-256 challenge relationship.
278 src/plugin-sdk/channel-replay-guard.ts READ One claim-id-checked ownership removal helper across commit, release and failed acquisition; live handles retain exclusive settlement.
276 src/plugin-sdk/command-auth.ts READ Shared access-group expansion closure across DM/group/store inputs; preserved parallel configured expansion and sequential DM-store expansion.
275 src/skills/workshop/experience-review-scheduler.ts READ Retained generation checks, per-agent/session keys, quiet-time rearming, eligibility, and queue bounds.
274 src/skills/runtime/remote-skills.ts READ Applied: remove always-true connected state (disconnect removes the map entry), redundant set copy, and compare omitted displayName against the effective retained value used for storage.
274 src/plugin-sdk/feature-plugin.ts READ Typed feature registration owns schema validation and closure-bound capabilities; no safe additional merge found.
273 src/skills/runtime/refresh-ancestor-native.ts READ Retained: Windows root deletion, inotify shared spelling, exact root admission, and rearm ownership checks cover distinct platform behavior.
272 src/state/openclaw-agent-schema-inspection-worker.ts READ unchanged parent IPC validation, caller deadlines, snapshot identity and child-exit settlement; the changed child owner is separately reread below.
270 src/plugin-sdk/control-ui.ts READ Browser-safe public types and plugin UI registration contract must remain stable; no behavior-identical structural reduction identified.
269 src/state/openclaw-state-db-schema-v13-widerow.ts READ Overlapping simplification landed in #156541; retain main implementation with no duplicate delta. Reuse canonical SQL table extraction for migration rebuilds; column and JSON projection behavior unchanged.
269 src/skills/discovery/chat-commands.ts READ , SIMPLIFIED: per-agent commands reuse workspace command option/eligibility preparation; preserve discovery ordering, single-agent session scoping, synchronous remote menus, and asynchronous cancellation.
266 src/state/openclaw-state-lease-heartbeat.worker.ts READ Read main existing-only physical identity open and Gateway access checks inside renewal; preserve SQLite lock-only contention policy.
266 src/skills/lifecycle/source-install.ts READ Retained local-path versus immutable Git source policy, redaction, export and provenance; prior deslop already consolidated installation.
265 src/plugin-sdk/facade-resolution-shared.ts READ Runtime-owner selection rejects ambiguity and cannot collapse into metadata fallback; source/dist/installed resolution ordering is intentional.
265 src/plugin-sdk/extension-shared.ts READ Shared passive-channel/status/proxy helpers retain distinct contracts and remain existing owners; no safe further consolidation identified.
263 src/skills/runtime/refresh-watch-targets.ts READ Retained: prior deslop already shared ordered comparison; bounded trusted-symlink scans intentionally remain distinct from registration-only target admission.
263 src/plugin-sdk/tool-plugin.ts READ Tool schema/manifest metadata and execute validation are existing canonical plugin construction; retain public types and registration behavior.
263 src/plugin-sdk/channel-route.ts READ Normalization/projection functions are public API; exact equality and parent-conversation compatibility intentionally apply different account/thread rules.
261 src/plugin-sdk/plugin-entry.ts READ READ whole module; mostly exact public export inventory plus cached config-schema getter; preserve deprecated-type metadata and optional property omission.
259 src/skills/workshop/reconcile-transition.ts READ Retained rollback integrity and previous/proposed/partial file-state classification; these govern whether recovery can safely modify live files.
258 src/state/openclaw-state-lease-worker-storage.ts READ Preserve main cleanup context/lifecycle-argument removal; retain unique equivalent error aggregation imported from sqlite-lifecycle-errors.
257 src/plugin-sdk/channel-config-ui-hints.ts READ Descriptor-driven hint groups already shared; labels, help bytes and legacy key ordering are rendered UI contracts.
254 src/skills/workshop/service-query.ts READ Retained fresh manifest reconciliation, degraded draft reporting, and agent scope; pending-only reconciliation already landed in #158757.
254 src/skills/library/import.ts READ source import and chunked upload use different trust/admission paths; staged upload replay, exact offset checks, profile quotas, and commit guards remain necessary.
253 src/state/openclaw-state-lease-worker.ts READ Single/plural ownership and acquisition/renewal/release have distinct authority and receipt behavior.
253 src/state/openclaw-state-db-task-delivery-recovery.ts READ Preservation-before-delete requires exact shape, integrity, row hash and fsync proof; retain each recovery gate.
253 src/skills/workshop/store-sqlite-event.ts READ Retained event decoding, payload/evaluation disjoint encoding, size bounds, and cursor semantics. Recent #158906 already simplified this owner.
251 src/state/openclaw-agent-db-resources.ts READ unchanged known/unresolved custody and synchronous/asynchronous resource admission, retries and drainage.
251 src/plugin-sdk/realtime-voice.ts READ READ whole module; export-only official-plugin runtime seam; removing or replacing explicit exports would violate lane surface contract.
250 src/state/openclaw-state-read.validation.ts READ Read main context protocol retirement; retain all remaining unknown-input and command payload validation.
249 src/skills/runtime/refresh-ancestor-watch.ts READ Retained: shared ancestor subscriptions retain separate ready, unavailable, error, and retirement fanout semantics.
245 src/skills/runtime/session-snapshot.ts READ Retained: previous deslop already reduced cache/signature work; waiter authority and projection versions remain distinct from cached snapshot identity.
245 src/skills/runtime/refresh-watch-registry.ts READ Retained: overlapping observation loss, initial-scan fan-in, supporting changes, and recovered coverage publish different facts.
245 src/plugin-sdk/webhook-memory-guards.ts READ Shared bounded timed-map lifecycle for rate-limit windows and diagnostic counters; retained distinct expiry clocks and disabled-TTL fast path.
244 src/state/openclaw-state-lease-storage.ts READ Read main removal of coordinator-contention fallback and native cleanup timer change; preserve canonical lease state and bounded native retry lifetime.
243 src/skills/runtime/env-overrides.ts READ Applied: derive sanitizer result type from sanitizeEnvVars rather than redeclaring its fields. Empty-input fast path retained because the owner otherwise loads secret/plugin metadata.
242 src/skills/runtime/tool-dispatch.ts READ Applied: pass the canonical metadata owner directly instead of forwarding callbacks; remove narrating header. Tool policy layers and sender/group/sandbox boundaries remain intact.
241 src/state/openclaw-schema-retirements.json READ Read complete historical retirement manifest; supported schema history is a frozen contract, not dead-code deletion material.
241 src/state/agent-deletion-journal.read.ts READ Runtime versus maintenance unknown-history behavior, fresh discovery admission and topology retry are intentional contracts; retain.
241 src/skills/lifecycle/upload-store.sqlite.ts READ SIMPLIFIED: inline the sole-caller optional metadata read and expiry-transaction forwarder in their owning operations; query bytes, opens, transaction boundaries and current lease checks are unchanged.
241 src/plugin-sdk/memory-host-event-export.ts READ Event export preserves host-journal boundary and bounded visible projection; no sound additional rewrite identified.
241 src/plugin-sdk/facade-activation-check.runtime.ts READ Activation facts and allowed public-surface selection stay at the existing owner; no independent redundant path identified.
238 src/state/openclaw-state-ownership.ts READ Read complete current main owner: preserve Gateway access checks, schema-maintenance sidecar recovery and moved error classes; retain only unique one-use snapshot wrapper inline.
234 src/plugin-sdk/access-groups.ts READ Allowlist parsing and redacted group diagnostics preserve security policy; no behavior-identical structural reduction identified.
233 src/plugin-sdk/provider-stream.ts READ Retained: wrapper order is observable and family-specific; public constants are shipped identity aliases, not removable duplicate owners.
232 src/skills/discovery/command-specs.ts READ prior deslop already consolidated synchronous/asynchronous assembly; retain unique-name reservation, dispatch diagnostics, and bundle command behavior.
230 src/skills/discovery/chat-command-invocation.ts READ prior deslop already combined invocation parsing; escape handling, unavailable-skill checks, and independent prompt bounds are meaningful contracts.
230 src/plugin-sdk/session-catalog-paging.ts READ Retained: cursor canonicality and UTF-8 truncation preserve exact public bytes; shared prefix helper differs for malformed UTF-16, so substitution rejected.
227 src/state/user-profile-writes.ts READ Prepared-publication equality, sequence checks, uncertainty fences and post-settlement cleanup protect lost-reply behavior; retain.
226 src/skills/workshop/store-record.ts READ Retained persisted-record and evaluator validators, including permissive legacy shapes and provenance constraints; schema acceptance is a hard contract.
225 src/state/claw-package-lifecycle-lease.ts READ Remove the impossible post-success acquired === false path; successful transaction completion already establishes acquisition. TTL, heartbeat and cleanup behavior remain identical.
225 src/plugin-sdk/ssrf-policy.ts READ SSRF allowlist/private-network normalization retains boundary semantics; no independent duplicate decision owner identified.
224 src/state/user-profile-writes.worker.ts READ One worker mutation context already owns before/after capture and commit receipts; operation-specific outputs remain explicit.
223 src/plugin-sdk/facade-runtime.ts READ Async and sync activation/load surfaces preserve caller timing and public contracts; no consolidation that preserves all semantics identified.
222 src/state/agent-deletion-discovery.ts READ Namespace selection distinguishes retained databases, adjacent artifacts and legacy uncertainty; merging branches would erase those contracts.
222 src/skills/workshop/proposal-draft.ts READ Retained full draft validation, traversal checks, frontmatter and byte budgets. Local UTF-8 truncation preserves lone surrogates differently from the shared Buffer-based helper, so replacing it would change behavior.
222 src/skills/workshop/proposal-bundle.ts READ , SIMPLIFIED. Create/update branches retain distinct collision and baseline checks, then use one candidate overlay and snapshot assembly.
219 src/skills/loading/skill-root-loader.ts READ retained bounded/audit source differences, canonical sync paths, and generated-plugin hardlink policy; previous sweep already established the shared contained-file read owner.
219 src/skills/loading/config.ts READ retained binary fact preparation and invalidation, degraded-secret gating and shipped config normalization; removing these checks would change accepted runtime inputs or cold-secret behavior.
217 src/state/user-preferences.store.ts READ Existing owner already consolidates serialized updates; merge ordering, key limits, CAS values and coauthor invalidation remain necessary.
217 src/state/openclaw-database-preflight-agent-scheduler.ts READ Bounded foreground/deferred scheduling preserves original result/failure order and joins inspection workers.
213 src/state/user-preferences.ts READ Native one-shot and worker runtime paths retain different admission/publication ownership; uncertainty settlement cannot be replaced by a pass-through wrapper.
213 src/state/openclaw-state-db-open.ts READ Newly over threshold and read complete: preserve main cold-open ownership, regular-file identity checks, schema-owner recursion and retained failed-close custody.
209 src/plugin-sdk/approval-client-helpers.ts READ Enablement, request filtering and local-prompt suppression have distinct public callback/normalization contracts; no sound further reduction.
208 src/plugin-sdk/channel-lifecycle.core.ts READ Fixed abort cleanup synchronous rejection and already-aborted synchronous server close; removed trivial status/listener forwarders.
207 src/skills/loading/workspace-skill-prompt.ts READ derive build options from the preparation owner; retain whole-resource selection, legacy cached-prompt recovery and degraded-owner filtering.
206 src/state/openclaw-state-db-schema-v12-foldin.ts READ Historical singleton payload conversions have distinct keys, nullability and timestamp rules; preserve supported migration.
205 src/state/agent-deletion-cleanup.ts READ Exact live cleanup custody, reverse close order, failed-close retention and aggregate outcomes enforce different failure contracts; retain.
204 src/skills/workshop/types.ts READ Retained protocol-derived records and workshop-only authority/rollback types; recent #158906 already consolidated common input context.
203 src/skills/workshop/policy.ts READ Retained approval detail sanitation, exact timeout messaging, and lazy lookup boundary.
201 src/plugin-sdk/approval-auth-helpers.ts READ Shared approver resolution and authorization projection; retain same-chat marker identity, wildcard distinctions, and all public types.

@clawsweeper

clawsweeper Bot commented Sep 27, 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.

@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 27, 2026
@clawsweeper

clawsweeper Bot commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 27, 2026, 1:08 PM ET / 17:08 UTC (Revision 15).

ClawSweeper review

What this changes

The branch consolidates Plugin SDK, SQLite state, and skill helpers while fixing abort cleanup, media-reader release, login cancellation, remote-skill refresh, and migration redaction edge cases.

Merge readiness

⛔ Blocked before merge - 4 items remain

Keep this PR open. Current main does not contain its distinct cleanup and fixes, and the reviewed code has no definite blocking defect. The remaining blocker is preservation of existing sessions and profiles through the changed legacy database copy paths.

Priority: P2
Reviewed head: 16fd3baa61771da0eade75439c1713cdb6fdda86

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The cleanup is coherent and extensively checked, but existing-state upgrade preservation has not been demonstrated.
Proof confidence 🦐 gold shrimp (3/6) Not applicable: The trusted-author general proof gate does not apply. Blacksmith Testbox results support the targeted SDK and skill fixes, but the altered legacy SQLite copy paths have no documented published-updater comparison of populated session and profile state; stored-data compatibility remains insufficient.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The trusted-author general proof gate does not apply. Blacksmith Testbox results support the targeted SDK and skill fixes, but the altered legacy SQLite copy paths have no documented published-updater comparison of populated session and profile state; stored-data compatibility remains insufficient.
Evidence reviewed 9 items Branch remains distinct from main: Current main has no changes in the three affected source trees since the pinned PR base; the PR still changes those trees.
Legacy session copy: The PR replaces parallel destination and expression arrays with one projection object used to copy older session rows.
Legacy window selection: The PR builds the existing entry and route owner queries through one selector before copying legacy session windows.
Findings None None.
Security None None.

How this fits together

The Plugin SDK connects channel and provider plugins to core dispatch; skill preparation supplies instructions to agent runs. SQLite state helpers read and update stored sessions and profiles, including during upgrades.

flowchart LR
A[Channel and provider calls] --> B[Plugin SDK helpers]
B --> C[Replies and task updates]
D[Skill files and remote catalogs] --> E[Skill preparation]
E --> F[Agent context]
G[Existing SQLite databases] --> H[State and migration helpers]
H --> F
Loading

Before merge

  • Resolve merge risk (P1) - Preservation of populated shared and per-agent SQLite sessions and profiles through the changed legacy copy paths remains unverified with the published updater; a bad upgrade could misassociate or lose existing state.
  • Complete next step (P2) - Attach a published-updater run for this head using populated shared and per-agent database copies, with before-and-after session and profile comparisons.
  • Review config compatibility - Confirm compatibility and upgrade impact for the changed config or default surface before merge.
  • Add data-model compatibility proof - Confirm migration or upgrade compatibility proof before merge.
Agent review details

Security

None.

PR surface

PR surface statistics unavailable: the file list is incomplete.

Review metrics

None.

Stored data model

Persistent data-model change detected: migration/backfill/repair: src/plugin-sdk/migration.ts, migration/backfill/repair: src/state/openclaw-agent-db-session-nodes-migration.ts, unknown-data-model-change: src/state/openclaw-agent-db-session-nodes-migration.ts, unknown-truncated-pull-files. Confirm migration or upgrade compatibility proof before merge.

Merge-risk options

Maintainer options:

  1. Prove the upgrade path (recommended)
    Run the published updater into this candidate with populated shared and per-agent databases, then compare session and profile identities and contents before and after.
  2. Pause the storage refactor
    Keep the PR open until the existing-state comparison can be completed if the upgrade cell is unavailable now.

Technical review

Best possible solution:

Retain the consolidated owners and verify session and profile preservation using the shipped updater, populated database copies, and before-and-after comparisons before landing.

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

Not applicable to the refactor as a whole. The PR reports original-source negative controls for five targeted fixes, while the legacy upgrade path still needs an existing-state comparison.

Is this the best way to solve the issue?

Yes for consolidating duplicate internal paths under existing owners; the storage portion needs upgrade evidence before its behavior-preserving claim is complete.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 2948123d63d1.

Labels

Label changes:

No label changes.

Label justifications:

  • P2: This is a useful cross-subsystem improvement with bounded runtime fixes, but no established urgent user regression.
  • merge-risk: 🚨 compatibility: The branch changes code that copies legacy persisted rows, so existing installations need upgrade-preservation evidence.
  • merge-risk: 🚨 session-state: The altered legacy session selection and copy paths could affect retained session ownership if their equivalence fails on existing data.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The trusted-author general proof gate does not apply. Blacksmith Testbox results support the targeted SDK and skill fixes, but the altered legacy SQLite copy paths have no documented published-updater comparison of populated session and profile state; stored-data compatibility remains insufficient.

Evidence

What I checked:

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Vincent Koc: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Kimi Yu: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rank-up moves

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

  • Capture before-and-after session and profile identities and contents in a published-updater run over populated database copies.

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.

History

Review history (14 earlier review cycles; latest 8 shown)
  • reviewed 2026-09-27T10:10:17.514Z sha cdbb2c34b649715c68cb209a678a8ba119da22fd :: blocked before merge. :: none
  • reviewed 2026-09-27T11:16:26.258Z sha bc859e6 :: blocked before merge. :: none
  • reviewed 2026-09-27T11:29:35.884Z sha bc859e6 :: blocked before merge. :: none
  • reviewed 2026-09-27T12:27:37.978Z sha bc859e6 :: blocked before merge. :: none
  • reviewed 2026-09-27T13:22:03.516Z sha bc859e6 :: blocked before merge. :: none
  • reviewed 2026-09-27T13:51:11.533Z sha 63e9505 :: blocked before merge. :: none
  • reviewed 2026-09-27T16:00:42.488Z sha e566640 :: blocked before merge. :: none
  • reviewed 2026-09-27T16:24:29.693Z sha e566640 :: blocked before merge. :: none

@steipete
steipete force-pushed the deslop/l105-sdk-state-skills branch 3 times, most recently from 310651c to cdbb2c3 Compare September 27, 2026 09:27
@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Sep 27, 2026
@steipete
steipete marked this pull request as ready for review September 27, 2026 09:42
@github-actions

github-actions Bot commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor

⚠️ Security sensitive changes

This maintainer PR changes sensitive security components. This comment is informational because the PR author has repository Maintain or Admin access.

  • Current SHA: 16fd3baa61771da0eade75439c1713cdb6fdda86
  • Maintainer: @steipete
  • Repository role: admin

These security sensitive changes were made:

  • src/skills/security/clawhub-verdicts.ts: Controls product security checks or trust decisions. Check whether the change weakens detection, protection, or remediation.

Carefully review these changes before merging.

@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels Sep 27, 2026
@steipete
steipete force-pushed the deslop/l105-sdk-state-skills branch from cdbb2c3 to bc859e6 Compare September 27, 2026 11:09
@steipete
steipete force-pushed the deslop/l105-sdk-state-skills branch from bc859e6 to 63e9505 Compare September 27, 2026 13:42
@steipete
steipete force-pushed the deslop/l105-sdk-state-skills branch from 63e9505 to e566640 Compare September 27, 2026 15:45
@steipete
steipete enabled auto-merge (squash) September 27, 2026 16:26
@steipete
steipete merged commit 87a5b39 into main Sep 27, 2026
215 checks passed
@steipete
steipete deleted the deslop/l105-sdk-state-skills branch September 27, 2026 17:19
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 28, 2026
…ills (openclaw#159299)

* refactor(sdk,state,skills): deslop plugin SDK internals, state and skills

* fix(sdk): preserve declaration surface and deterministic API reports

* refactor(sdk): retain typed loaders and owned callbacks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. security-sensitive-changed size: XL 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