Repository navigation
feat: offload data-only keyed plugin state operations - #146557
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: blocked before merge. Reviewed September 14, 2026, 7:10 PM ET / 23:10 UTC (Revision 16). ClawSweeper reviewWhat this changesMoves ten plugin key-value operations onto the shared SQLite worker, adds optional scalar conditional deletion, and adapts Slack cleanup and test routing. Merge readiness⛔ Blocked before merge - 3 items remain This remains useful work: current main still executes asynchronous keyed-store calls synchronously. No blocking introduced defect was found, and the latest fixture-only follow-up preserves the previously qualified runtime. Priority: P2 Review scores
Verification
How this fits togetherPlugin keyed stores persist plugin-scoped values in OpenClaw’s shared SQLite database. The asynchronous facade sends data-only operations to the existing database worker and returns decoded results or typed errors to callers. flowchart LR
A[Plugin callers] --> B[Validate and serialize]
B --> C{Operation kind}
C -->|Data only| D[Shared SQLite worker]
C -->|Legacy callback| E[Synchronous transaction]
D --> F[Shared SQLite database]
E --> F
F --> G[Values and typed errors]
Before merge
Agent review detailsSecurityNone. PR surfacePR surface statistics unavailable: the file list is incomplete. Review metrics
Stored data modelPersistent data-model change detected: Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep data-only operations on the canonical shared actor, preserve atomic callback compatibility, and retain the documented older-host cooldown behavior. Do we have a high-confidence way to reproduce the issue? Yes, source establishes the current-main behavior: asynchronous keyed-store methods directly execute synchronous SQLite operations. No runtime reproduction was executed during this read-only review. Is this the best way to solve the issue? Yes. Reusing the shared actor and transaction kernels avoids a competing persistence owner while preserving the callback API and stored representation. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against bc8f013eae00. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (15 earlier review cycles; latest 8 shown)
|
6d4677b to
caf4c17
Compare
caf4c17 to
c302405
Compare
Await the existing shared-state close owner before resetting test stores and removing temporary state in 37 verified extension fixtures. Preserve producer completion, synchronous failure-latch resets, and assertions. Eighteen selected ordinary cases and the canonical scoped checks pass. Independent P2 review of the complete fixture packet is clean. This follow-up changes tests only; runtime source and installed-package proof remain bound to 0950426.
Admit both messages inside the existing 20 ms window before advancing its clock, and join only the test album queue work before restoring globals. Preserve all policy assertions and the real 75 ms completion criterion. Cleanup retains admitted work even when settlement outlasts that deadline; this does not claim bounded teardown for arbitrary hung KV work. Move the unchanged channel-post context builder into existing test support to keep the fixture within its line limit. The positive all-policy case, canonical scoped checks, and fresh P2 review pass. Other table cases were source-reviewed without replay.
Preserve current metadata, session delivery, preference, Health, audit, and TaskFlow dispatch alongside the ten worker-backed keyed operations. Retain canonical test routing and qualify maintenance release through its current resource owner.
Preserve the qualified keyed-store worker and resource lifecycle while composing the landed maintenance prerequisite. Keep the unique database-worker inventory and current full-suite partitioning.
Compose the native main baseline while retaining each database-worker consumer once, including Wizard provenance. Preserve the qualified keyed-store source and the independently landed TaskFlow diagnostic improvement.
Expect the database worker watch wrapper for directory watch selections and the separate infra plan for the core memory-search consumer. Keep exact argument ordering and selection assertions for both owner paths.
Compose the landed UI fixture and current main while retaining the complete shared-worker operation map and unique test ownership. Keep the qualified mixed Gateway watch and aggregate fixture corrections.
|
Merged via squash.
|
What Problem This Solves
Plugin keyed-store methods return Promises while their SQLite work still blocks the calling thread.
User Impact
Ten data-only keyed operations execute SQLite in the shared-state worker while preserving values, errors, expiry, capacity, and ordering. Validation and serialization remain on the caller thread. Synchronous stores and callback-based
updateanddeleteIfretain their documented deprecation contract. On older hosts without optional scalar conditional deletion, Slack retains a relinquished cooldown until expiry (up to eight hours), preserving a newer reservation rather than risking its deletion.Why This Change Was Made
The worker and synchronous API share query and mutation kernels. Consume remains atomic, bulk reads preserve input positions and per-key errors, and reads do not create missing stores. Scalar conditional deletion lets Slack relinquish its own presence cooldown without a callback.
The canonical shared actor retains TaskFlow, metadata, session-delivery, preferences, Cron, Health, and audit operations. Maintenance ownership and shared fixture fixes landed independently in #148126, #147986, and #148444. This composition preserves those owners and the complete unique test inventory. The two remaining tooling fixtures now assert the actual watch wrapper and separate Gateway/infra plans without weakening selection or ordering assertions.
No schema, stored-data layout, configuration, retention, or OpenClaw version change is introduced.
Evidence
Candidate
cd387fc53eefcarries one fixture-only follow-up to the qualified runtime at25c62c39d75b. The iMessage self-chat test now makes its unchanged eight-dispatch assertion after the monitor has joined admitted work. The exact ordered messages, no-error and no-loop assertions, and test deadline are unchanged. Its targeted ordinary synthetic case, scoped gate, and fresh P2 review passed.The runtime composition preserves 81 unique core-worker entries and 93 unique extension-worker entries. Eight pure routing/build-graph controls, two ordinary KV/Health controls, and complete source review passed. The normal
25c62build and canonical package checks passed; local artifact SHA-256804d0e085e1ab7d62b64427f0a6b7c423e01c58142b085992e151e2e93a2560bis 71,505,920 bytes, with all 9,740 dist files matching its build. Both standalone workers and the expected KV exports were verified. This is local static package proof, not a new installed run; the fixture-only successor does not change its runtime inputs.Completed CI for
25c62c39d75bpassed 136 jobs with 10 skipped. Its sole substantive failure observed three dispatches in the self-chat test's pre-drain polling window; the aggregate gate also failed. The follow-up uses the existing completion owner and preserves the original failure evidence without claiming a precise slow-operation cause or an unrecorded post-drain count. Exact follow-up CI passed 139 jobs with 10 skipped, including the repaired self-chat case. Native preparation completed on the same head with hosted gates verified.An earlier ordinary TaskFlow creation error lost its original cause and remains unattributed. Later passes and the landed cause-preservation improvement do not diagnose that historical failure. The Telegram fixture deliberately admits both messages within one controlled 20 ms window; its 75 ms real-time guard bounds successful completion, while cleanup joins admitted work and can outlast it. No cross-window policy atomicity is claimed.
Prior-head installed qualification on exact
d6297838549dpassed through the published2026.9.4updater, ordinary Doctor, ten compiled host-facade KV operations, close/reopen, manual synthetic Gateway restart, and retained TaskFlow/backup continuity. That run’s Linux package is SHA-256ac52b43fbe7a0808eb6f46421a4d4704333342e6b6b8d825d87762fac2515b60(71,377,086 bytes); five installed inventories match all 9,713 packaged regular dist files. Startup took 14 seconds. Original collection and independent receipt review passed, and the owned Testbox was stopped. A post-result runner-portal sync timeout is retained as a warning.The KV implementation and caller source remain unchanged. Intervening main updates changed build and packaging inputs, including standalone-worker construction; the
25c62build, static package audit, and ordinary controls qualify those inputs. Thed629/ac52run remains evidence for the unchanged mechanism, not an installed receipt for this new head. Historical packages retain their original identities.The three measured SQL intervals excluded preflight, legacy controls, and final drain; they establish neither registered-plugin admission nor whole-Gateway zero SQL. The restart uses the ordinary manual synthetic route, not native service-manager restoration. Historical095 evidence and the independent maintenance updater proof keep their original source and package identities.
Related: #144592. Callback/CAS and other worker migrations remain separate work.