Skip to content

feat(plugin-sdk): add worker-owned keyed state - #168478

Merged
steipete merged 14 commits into
mainfrom
dbasync/sw7b-1
Oct 10, 2026
Merged

steipete merged 14 commits into
mainfrom
dbasync/sw7b-1

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

Plugin state callbacks can perform SQLite work on the Gateway thread, including APIs that return a Promise.

User Impact

Plugin authors gain a versioned worker-owned keyed store; existing synchronous and callback APIs keep their completion semantics through the current Plugin SDK major.

Legacy forms warn on actual use and name their replacement and removal in the next Plugin SDK major. FaceTime retains its declared >=2026.9.4 support by selecting the available API before any operation; it never retries a failed V2 operation through native storage. Final synchronous authority guards remain until the later guard cutover. CAS compares observed contents and timestamps; it does not claim monotonic incarnation or equal-byte ABA protection.

Why This Change Was Made

Adds api.runtime.state.openKeyedStoreV2 and the matching SDK factory, using the existing worker store and observe/compare-and-apply operations. Runtime stores capture plugin identity and lifetime. Bundled state consumers migrate together, including ClickClack, iMessage, Signal, FaceTime, Zalouser and core caches. All deprecations reuse the shared warning owner.

This is part 1 of the nine-part S7 state/binding migration stack. Targets main; validation compares this part with its actual stack parent 413d5f9bb3f7. The stack integrates pinned main 413d5f9bb3f7.

Known follow-up: a released synchronous SDK writer can replace a ClickClack binding while old-room revocation awaits; cleanup can then delete the successor association. Ordinary same-service callers are serialized and remote room data remains intact. A follow-up should condition cleanup on the expected room identity.

Evidence

Changed lines against the parent: production +809 / -592; tests and fixtures +786 / -503.

Focused integrated receipts cover keyed-state worker operations, released SDK compatibility, runtime factories, and bundled persistence: 468 passed, 3 skipped, mapped to 33/33 changed test files. The shared released fixture includes one publisher case added in part 5; this prefix originally had three fixture cases. These are recorded integrated file versions, not independent runs of every prefix; per-part counts are not additive. Stack totals are 3,296 passing receipts, 3,295 after removing one known relocation duplicate, and three skipped cases across 177 files; no required focused file remains missing.

Recorded file spans total 135.675s. The relevant repaired integration batch took 496.047s wall time for 22 files; that is not a standalone timing for this part. File spans and invocation wall times are distinct; CI runner seconds were not measured.

Owner-reviewed native SDK digest: da8e6642534379647d22726554472fb7a09502b89d32731468780857f2cf5e40. Zero released export removals; the digest reconciles to this parent/head through the generated-only baseline change. Compatible keyed-state additions retain the released callback forms.

The S7 family audit at c3667d2 resolved 18,862 inputs, 1,766 calls, 521 imports and 78 member references: 153 explicitly classified retained edges, zero unknown edges or async-contract errors. The publisher repair changed five scanned modules containing none of those captured family edges; retained-edge sources stayed unchanged. Final source differs from the passing repair head only by its generated assertion baseline. This preserves the original scan provenance rather than claiming a new full scan.

Core and extension production typechecks passed for all nine source prefixes; the final generated-only assertion-baseline adjustment does not change their code. The selected check-changed commands were executed, with the inherited failures below preserved.

Inherited failures remain explicit: Knip flags .github/actions/setup-release-harness/narrow-lockfile.mjs and src/infra/sqlite-source-fence-admission.ts; the production export scan flags PUBLIC_SESSION_ENTRY_SCRIPT; core lint has 10 unchanged max-lines findings; the environment-name count is 456/455, including unchanged OPENCLAW_PITCH. Relevant source/config blobs equal the pinned base. No blanket check-changed-green claim is made.

Three scoped review rounds completed. Accepted correctness findings were repaired; remaining scoped follow-ups are recorded in the relevant PR descriptions.

Final repair checks passed at 4b7d96b620ea: scoped lint (30.02 s), affected test types (342.12 s), import-cycle guard (23.46 s), and Madge (14.91 s).

Exact-final remote pnpm build passed in 369.642s. The qualified Matrix cold-import snapshot measured 104.992 MiB peak RSS, +58.199 MiB versus the empty baseline, and 383.791ms process CPU. Child/process-group cleanup and temporary-home removal were verified. This is a cold-import snapshot; the dependency closure is not attested. Statement-gate evidence follows separately; the update cell remains pending for the lander.

Paired statement and request evidence

SQL statement gate

Accepted for 413d5f9bb3f7 → 5915284db816. Same synthetic workload, ten warmed turns per run; three original alternating pairs followed by two extra pairs. All five pairs are retained. Values below are base→head medians; warmed SQL/requests are per turn, while warmed wall time covers all ten turns. MAIN is Gateway-main-thread SQL. Wall ratio is head/base; no duration skew.

Phase All-thread SQL MAIN SQL Worker requests Wall seconds (ratio)
Boot 2320→2321 1933→1933 59→59 10.310→10.190 (0.9884×)
Connect 1284→1171 126→126 52→48 1.218→1.213 (0.9959×)
First turn 2386→2599 94→91 355→355 8.649→8.296 (0.9592×)
Warmed mean/turn 1007→1009.8 6.9→6.9 195.3→195.7 18.699→18.641 (0.9969×)
Second session 3848→3850 117→117 662→661 7.395→7.693 (1.0403×)
Control plane 33→33 0→0 5→5 1.108→1.097 (0.9901×)
Cron 1370→1373 53→53 209→209 5.489→5.463 (0.9953×)
Compaction 402→402 25→25 83→83 1.388→1.456 (1.0490×)
Shutdown 195→195 129→129 14→14 0.682→0.648 (0.9501×)
Whole workload 21926→22038 2549→2552 3395→3398 55.169→54.520 (0.9882×)
Chronology First-turn SQL Warmed SQL/turn Whole SQL Whole requests Whole wall ratio
Primary3 2587→2605 1006.4→1006.9 21999→22045 3395→3401 0.9875×
Extra4 1905→2358 1041.6→1024.2 21860→21932 3366→3383 0.9882×
Cumulative4 2486.5→2602 1006.7→1008.35 21962→22036.5 3392.5→3399 0.9879×
Extra5 2322→2570 1015.1→1011.6 21926→22038 3395→3398 1.0168×
Cumulative5 2386→2599 1007→1009.8 21926→22038 3395→3398 0.9882×

The original first-turn increase 2587→2605 and warmed increase 1006.4→1006.9 triggered RAW TURN follow-up. Extra4 remained +72 whole SQL/+17 requests; extra5 remained +112/+3. The cumulative five-pair first/warmed increases are +213/+2.8, with whole workload +112/+3. None of those positive results is discarded or described as a saving.

Exact changed-function attribution found six SQL/stack signatures across the 48 changed production TypeScript paths, all through observePluginStateEntry and compareAndApplyPluginStateEntry. The former is byte-identical; the latter differs only by the new optional conditions loop, which this workload never executes. Async keyed-store observe/entries, quarantine-list functions and the memory provenance read are also byte-identical. Request/SQL counts for the relevant plugin-state operations are:

Operation Each side, runs 1–3 Extra4 base→head Each side, extra5 Each side, diagnostic6
observe 17 / 102 15 / 90→17 / 102 17 / 102 19 / 114
compareUpdate 17 / 153 15 / 135→17 / 153 17 / 153 19 / 171
compareDelete 34 / 221 30 / 195→34 / 221 34 / 221 38 / 247
entries 10 / 20 10 / 20→10 / 20 10 / 20 12 / 24
sweep 1 / 6 1 / 6→1 / 6 1 / 6 1 / 6

Cells are whole-workload requests / SQL. Extra4 contains two additional first-turn memory workspace-lock cycles (+56 SQL), from one additional indexed source's embedding-cache persistence and chunk writes; these producing functions are unchanged. This identifies the extra work, not why that source was scheduled. Warmed observe/update/delete counts match within every original pair; entries shift between phases while whole-workload totals remain equal. No extra5 SQL/request stack reaches the new provenance write/clear, synchronous warning or runtime-health-clear paths.

Separate diagnostic6 RAW follow-up: both sides use the same additional diagnostic instrumentation; it is not pooled into the original five pairs. Whole SQL 22515→22325, requests 3476→3442, and wall 67.645→67.402 s satisfy the recorded follow-up condition. First-turn SQL is 2553→2418 and warmed SQL 1059.3→1030.1. This is not a product performance improvement: lower totals include omitted existing startup cleanup/recovery work.

Diagnostic6 startup operation Base requests / SQL Head requests / SQL
Generic session-entry list 3 / 39 2 / 25
Lifecycle artifact plan 1 / 24 0 / 0
Pending archives 2 / 18 1 / 3
These operations 6 / 81 3 / 28

The head captures a missing database before awaiting writer admission, then sees the newly created file and rejects cleanup with SQLite lifecycle cleanup database owner changed; the base retains an existing file identity and completes cleanup. The base also discovers a newly created empty database and performs restart-recovery listing; the head has no corresponding recovery frames or list. The leaf-only observer does not identify the exact parent-directory guard behind that omission. These owners are byte-identical. The retry lies outside the workload window. Diagnostic6 demonstrates that mechanism, but the lost extra5 warning prevents assigning the same exact exception to extra5. The unchanged cleanup/admission race remains an explicit follow-up outside this change; the remaining whole-workload delta is not wholly attributed to those three startup operations. Diagnostic plugin-state counts and source.replace (1 request / 21 SQL per side) are equal.

Separate diagnostic6 phase values (not pooled)
Phase All-thread SQL MAIN SQL Worker requests Wall seconds (ratio)
Boot 2319→2319 1933→1933 59→59 10.407→10.459 (1.0050×)
Connect 1150→1297 126→129 48→52 1.216→1.217 (1.0008×)
First turn 2553→2418 92→100 345→358 9.927→9.994 (1.0067×)
Warmed mean/turn 1059.3→1030.1 11.5→9.2 203.4→198 26.064→25.568 (0.9810×)
Second session 4080→3938 148→130 710→674 9.661→9.867 (1.0213×)
Control plane 34→33 0→0 5→5 1.132→1.144 (1.0106×)
Cron 1186→1413 44→67 177→216 6.927→6.900 (0.9961×)
Compaction 405→411 25→25 84→84 1.514→1.524 (1.0066×)
Shutdown 195→195 124→129 14→14 0.797→0.729 (0.9147×)
Whole workload 22515→22325 2607→2605 3476→3442 67.645→67.402 (0.9964×)

The published-driver × candidate update cell is pending (lander). No release, package publication or Plugin SDK major bump is included.

Plugin state callbacks can perform SQLite work on the Gateway thread, including APIs that return a Promise.

Plugin authors gain a versioned worker-owned keyed store; existing synchronous and callback APIs keep their completion semantics through the current Plugin SDK major.
@clawsweeper

clawsweeper Bot commented Oct 10, 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 channel: imessage Channel integration: imessage channel: signal Channel integration: signal channel: zalouser Channel integration: zalouser agents Agent runtime and tooling plugin: file-transfer extensions: crabbox extensions: onepassword 1Password plugin plugin: facetime FaceTime plugin extensions: clickclack size: XL labels Oct 10, 2026
@clawsweeper

clawsweeper Bot commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge.

What this changes

Adds lifecycle-bound V2 keyed-state stores and migrates bundled consumers while preserving released legacy APIs.

Example: A plugin increments the stored counter "counter" from 7 to 8.

  • Before: The awaited legacy update callback can execute SQLite work on the Gateway thread.
  • After: The plugin observes 7 and conditionally writes 8 through the worker, handling an explicit conflict if another writer intervenes.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) Useful, maintainer-directed work with repaired regressions; authority evidence and the explicitly pending published-driver upgrade cell prevent clearance.
Proof confidence 🦐 gold shrimp (3/6) Real behavior proof is necessary before merge. See Before merge.
Patch quality 🦐 gold shrimp (3/6) Security review found an item that needs attention.

Product

Kind: Refactor · Worth it: Yes · Fix scope: Complete
User problem: Plugin persistence callbacks can stall unrelated Gateway work despite returning promises.
Reason: The maintainer-authored direction centralizes a capability used by several bundled consumers and preserves released APIs.

Merge readiness

⛔ Blocked before merge - 4 items remain

Keep this maintainer-directed PR open: it provides a distinct worker-owned SDK capability, and the earlier correctness findings remain repaired.

Priority: P2
Reviewed head: c5e53dcccadee8681ea7ab020b730a3e6718ed06

Before merge

  • Add real behavior proof - Authority-chain proof required: Gateway SQL telemetry and focused repair receipts support persistence and lifecycle behavior, but do not show retained V2 runtime/action authority revoked during queued admission rejected before commit, or stale ClickClack binding/account authority rejected before channel I/O. Provide allowed and nearest-forbidden traces, redacting IPs, keys, phone numbers, and non-public endpoints. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
  • Resolve security review attention item - Source contains final-effect authority checks, but their denial behavior remains unverified.
  • Resolve merge risk - Retained runtime/action authority and ClickClack binding/account authority cross asynchronous boundaries; denial of unauthorized final effects remains unverified.
  • Add data-model compatibility proof - The review found that existing stored data may not work after upgrade. Show that existing data still loads and works with this change.

Findings

None.

Tests

  • Missing end-to-end proof: Supplied telemetry and regression receipts do not demonstrate revoked V2 authority denied before commit or stale ClickClack authority denied before channel I/O.
Agent review details

How this fits together

Plugin runtime factories bind plugin identity and current authority to keyed-state operations; the shared SQLite worker commits mutations and publishes their results back to callers.

flowchart LR
Plugin[Plugin caller] --> Runtime[Runtime V2 factory]
Runtime --> Authority[Runtime and action authority]
Authority --> Worker[Shared state worker]
Worker --> SQLite[Plugin state SQLite]
SQLite --> Facts[Committed facts]
Facts --> Plugin
Loading

Technical review

Best possible solution:

Complete the V2 cutover through the existing worker owner while retaining released completion contracts and validating existing-state upgrades.

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

Source confirms that legacy awaited update/deleteIf methods invoke synchronous native callbacks; no target code or tests were executed during this review.

Is this the best way to solve the issue?

The versioned data-only store reuses the existing worker and comparison owners, preserves legacy contracts, and avoids replaying failed worker operations through synchronous storage.

AGENTS.md: found and applied where relevant.

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

Merge-risk options

Maintainer options:

  1. Hold for final-effect authority evidence (recommended)
    Keep the PR open until the PR owner demonstrates allowed operations and rejection after runtime/action revocation or ClickClack authority replacement before the corresponding commit or channel request.

Provenance checked

  • Legacy keyed-state compatibility and diagnostics changes intended behavior with a stated reason (3b03121: Preserve synchronous completion and transaction-local callbacks while documenting a supported migration; runtime warnings were deliberately deferred.)
  • Worker comparisons and bundled consumers keeps the original intent (0fa3d0f: Move conditional state updates into workers without changing cursor, retry, delivery, or retirement behavior.)
  • ClickClack lifecycle and recovery keeps the original intent (af78348: Drain accepted operations and preserve durable recovery, quarantine ordering, and live authority.)
  • FaceTime older-host persistence keeps the original intent (71fba99: Move pending-call persistence off the Gateway thread while preserving the declared older-host atomic cleanup path.)

Testing

Proof path: in-process harness.

Security

Needs attention: Source contains final-effect authority checks, but their denial behavior remains unverified.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit 652060a adds src/plugin-state/plugin-state-store.ts:16 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 652060a77e09; files: src/plugin-state/plugin-state-store.ts)
  • Alex Knight: Raw commit bbf985d adds src/plugin-state/plugin-state-store.ts:3 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: bbf985d50a64; files: src/plugin-state/plugin-state-store.ts)

PR surface

PR surface statistics unavailable: the file list is incomplete.

Labels

Label changes:

No label changes.

Label justifications:

  • P2: This is a normal-priority improvement to shared persistence and Gateway responsiveness.
  • merge-risk: 🚨 compatibility: The maintainer-directed change expands the public SDK and migrates bundled consumers while retaining released legacy signatures and completion semantics.
  • merge-risk: 🚨 security-boundary: Runtime/action authority governs queued writes, and persisted ClickClack binding authority governs later channel effects.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🦐 gold shrimp.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Rank-up moves

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

  • Add final-effect proof for queued V2 runtime/action revocation and stale ClickClack binding/account authority.
  • Complete the published 2026.9.9 driver × candidate upgrade run with existing settings, plugin records, and legacy revocation markers intact.

Rating scale

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

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only; repair and merge need explicit maintainer commands such as @clawsweeper autofix or @clawsweeper automerge.

History

Review history (5 earlier review cycles)
  • reviewed 2026-10-10T14:32:02.000Z sha 5915284 :: needs real behavior proof before merge. :: [P1] Condition cleanup on the binding being revoked | [P2] Handle session replacement before publishing reconciled metadata
  • reviewed 2026-10-10T16:16:54.972Z sha 6cfbc8f :: needs real behavior proof before merge. :: [P2] Complete the V2 cutover in the remaining integration fixtures
  • reviewed 2026-10-10T16:39:42.704Z sha e496e9b :: needs real behavior proof before merge. :: none
  • reviewed 2026-10-10T17:07:07.492Z sha 3c193b9 :: needs real behavior proof before merge. :: none
  • reviewed 2026-10-10T19:01:34.616Z sha 49c7e32 :: needs real behavior proof before merge. :: none

Reviewed October 10, 2026, 3:46 PM ET / 19:46 UTC (Revision 6).

@steipete

Copy link
Copy Markdown
Contributor Author

Landing stopped at this first PR; no branch updates or merges were performed.

The completed ClawSweeper review of 5915284db81630d26782e8dc03e64a6624f07db8 identifies a production ownership regression:

[P1] Condition cleanup on the binding being revoked — extensions/clickclack/src/discussions/service.ts:612-613
If a released synchronous SDK writer replaces session S's room A with room B while the new revocation await is pending, the subsequent deletion removes B. The service queue and mutation lock do not serialize that external writer. Previously revocation and deletion ran without this intervening await. Delete only the observed association using an atomic conditional mutation, and preserve its successor and routing index. The PR's recorded follow-up confirms this reachable loss of association.

Source inspection confirms that #revokeAndDeleteBinding awaits the revocation write and then deletes by session key without an expected binding. Fixing only that deletion is insufficient for the #open caller: it continues into openClickClackDiscussionBinding, whose final store.set validates the session/config but does not condition publication on the old binding remaining current. The cleanup result must be consumed across the owning lifecycle so a successor is preserved, including its routing index. This needs an ownership repair beyond a mechanical landing fix.

Exact-head CI also confirms a separate production regression: run 38059495815, job 114234998635, extensions/clickclack/src/discussions/service-events.test.ts → does not overwrite a replacement attachment when metadata reconciliation settles late, rejects with ClickClack discussion authority changed before channel update at the post-response store.set. The replacement has already been attached, but publication still uses the old incarnation's authority closure.

Other failures remain unqualified, not waived: the Zalouser Doctor case reaches an unconfigured V2 store mock; the iMessage current-message integration has modern and legacy-path failures; memory cold-rebuild reports TRANSCRIPT_COLD. The bundle-3 log retrieval failed with an invalid cached ZIP. These are not claimed to be inherited or fixed, and no reruns were requested.

The published-driver × candidate update cell remains pending. It was not run against a head blocked on production repair. No remote lease was allocated. Later stack PRs were not retargeted or modified; the final Reef catchup-read question remains pending before its eventual landing.

@steipete

Copy link
Copy Markdown
Contributor Author

Fixed the two confirmed ClickClack lifecycle races in 5dae469481860.

Binding cleanup and metadata reconciliation now use the worker's atomic comparison against their captured owner. Cleanup cannot delete or replace a successor, and a late metadata response leaves the replacement attachment unchanged. A subsequent reconciliation applies the replacement session's metadata.

The repair also covers a successor that keeps the same channel: cleanup revocations carry their captured binding, and conditional writes preserve newer revocation evidence. Legacy and quarantine tombstones remain unconditional. This preserves revoke-before-delete crash ordering without disabling a successor. New-channel publication requires the binding to remain absent; an obsolete remote candidate stays quarantined.

The deterministic regressions hold revocation, deletion, and final publication and install successors on the same or a different channel. The late-reconciliation test holds the remote response while the session attachment is replaced. No sleeps were added. An additional boundary test preserves unconditional quarantine precedence.

Validation ran on one remote AWS lease after Testbox did not assign a runner, under the campaign remote lease gate. The exact CI failure from run 38059495815 / job 114234998635 was reproduced on pristine 5915284db816: does not overwrite a replacement attachment when metadata reconciliation settles late rejected with ClickClack discussion authority changed before channel update. Seven fixture-only negative controls on the original production code failed for the intended race conditions.

The repaired source passed 204 tests across 13 files, including the worker prepared-state suite and ClickClack lifecycle, persistence, inbound routing, retention, registration, and tool-policy suites. All used the repository runner with --maxWorkers=1. Measured Linux command wall times and Vitest file execution costs:

Scope Tests Command wall File execution
service-events.test.ts 15 32.34 s 0.131 s
service-state-persistence.test.ts 18 43.04 s 10.287 s
Remaining 11 focused files 171 44.62 s 3.541 s total

These are remote proof measurements; new GitHub CI seconds are not yet measured. Cold worker preparation accounts for much of the command wall time. Before/after file hashes matched the reviewed repair. Final independent review is clean for actionable P0/P1 findings.

The native check:changed plan passed formatting, extension production/test types, plugin boundaries, deprecation checks, worker and storage guards, affected lint after the fixture correction, and import-cycle checks. The full command remains blocked by two inherited diagnostics, each reproduced on pristine 5915284db816:

  • Environment budget: OPENCLAW_* 456 > 455.
  • Production dead-export scan: PUBLIC_SESSION_ENTRY_SCRIPT in untouched src/gateway/control-ui-public-session-render.ts. Script and full-tree dead-export scans passed.

The fixture's no-shadow error found during validation was corrected in 6cfbc8f2d0229; its targeted lint and formatting reruns passed. That identifier-only correction leaves the behavioral proof valid and also passed independent review. No guards or baselines were relaxed. These results do not claim that the original PR's unrelated CI failures are resolved.

Repair delta: production +229/−56 lines, tests/support +294/−56, documentation +13. No released SDK export, SQLite schema, dependency, lockfile, or generated-baseline changes. The original stack's SQL and SDK evidence remains prior-head evidence; this bounded race repair did not rerun the full statement workload or SDK measurement.

Propagated through all eight later stack branches with clean merges and verified identical ClickClack source. No main integration or unrelated fixes were added.

PR Updated head
#168478 6cfbc8f2d022
#168479 23cf71e9dc2c
#168480 cc28149d8a3d
#168481 b1971e06b4e3
#168482 6313e3c01563
#168483 f49be41f51d1
#168484 0598d13d6511
#168485 a4a236172549
#168486 7a989bef9d6e

The update cell remains pending (lander). No PRs merged. Stopping here for the stack lander to resume.

@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: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Oct 10, 2026
@steipete

Copy link
Copy Markdown
Contributor Author

Landing repair at 3c193b97473a721884afe67dce875193ee5f5638:

  • Merged main at 92ebbb8e159b4ff01e469bb37ed75f4802c91857 without conflicts; preserved the captured-binding lifecycle repairs.
  • Wired the iMessage and Zalouser integration fixtures to real V2 stores. The iMessage test still seeds persisted legacy data and checks both allowed dispatch and wrong-chat rejection through the registered adapter. Removed its retired synchronous adapter case.
  • Moved the FaceTime deletion observers before runtime construction: the store now captures comparison methods during construction, so later spies missed the actual deletion and left three tests waiting indefinitely. No production behavior or assertions changed in this repair.

Focused proof: pnpm test test/imessage-reply-alias.integration.test.ts extensions/zalouser/doctor-contract-api.test.ts extensions/facetime/tests/runtime-reconciliation.test.ts --maxWorkers=1 passed 13 tests in 3 files, 163.32 seconds including worker preparation. Ran through the campaign local proof slot after the remote queue exceeded 30 minutes and host load was below 48. Both repair diffs passed independent P0/P1 review. Required CI is running on the new head. The published-driver × candidate update cell remains pending in the campaign remote-slot queue; no merge has been attempted.

@steipete

Copy link
Copy Markdown
Contributor Author

Stopping this stack at #168478, current head 3c193b97473a721884afe67dce875193ee5f5638. No PRs merged; the eight dependent PRs remain untouched.

The V2 fixture cutover and FaceTime observer-order repairs passed independent P0/P1 review and all 13 focused tests across three files. Current-head CI still fails in job 114263711619, run 38069343924:

src/plugins/runtime/runtime-agent.test.ts — rejects a session replaced while work waits for lifecycle admission: promise resolved undefined instead of rejecting with SESSION_WORK_START_CHANGED.

That test and its runtime implementation are unchanged by this PR. A verified isolated run on main baseline 92ebbb8e159b4ff01e469bb37ed75f4802c91857 passed all 19 tests in the file, including this case (345.86 seconds including worker compilation). I did not find an identical recent-main failure. This is therefore unclassified, not an approved inherited failure; no CI rerun, admin bypass, or REST merge was used. Native review artifacts retain NEEDS WORK.

The published-driver 2026.9.9 × candidate update cell also remains pending. After roughly 45 minutes in the campaign remote-slot queue, the first Testbox payload stopped before the cell because it compared the wrapper's synthetic carrier commit to the candidate SHA. The wrapper correctly attested candidate 3c193b97473a, tree e3ef31c8bc024c9eeee7efc91e5bd076570f4ab1; the corrected payload uses that exact tree. Its Testbox lease expired during source preparation before the cell executed. No update pass is claimed. Remote leases are stopped/released at handoff.

The final Reef catchup-read gate has not been cleared; it still must be resolved before #168486 can land.

Restore the immediate initial read for ordinary host-owned sessions so the existing admission check rejects replacements made while work is queued. Keep bound incognito reads asynchronous and retain the existing session-replacement regression.
# Conflicts:
#	src/plugin-sdk/plugin-state-test-runtime.ts
#	src/plugin-state/plugin-state-store.comparison.ts
#	src/plugin-state/plugin-state-store.ts
#	src/plugin-state/plugin-state-store.types.ts
#	src/plugins/registry-runtime.ts
@steipete

Copy link
Copy Markdown
Contributor Author

Landing proof for c5e53dcccadee8681ea7ab020b730a3e6718ed06: integrated main conflict-only, retaining the synchronous session-identity repair and both worker-store API generations. Focused conflict-owner proof passed 120 tests across nine files in 229.36s. Required CI is green.

The published 2026.9.9 driver × exact candidate update cell passed on AWS, candidate tree 7a0adbfbe7a591ef58da6522120e6d1c026aa2e4, run run_3d6590a7c9c48b16a12382d7e111cda1. This pass will be reused for intermediate stack PRs; the final applicable cell is rerun on #168486. Testbox was queued, so the authorized AWS fallback was used. Completed ClawSweeper review is reused; no new review requested under the coordinator's relaxed landing direction.

@steipete
steipete merged commit 6b5284f into main Oct 10, 2026
142 checks passed
@steipete
steipete deleted the dbasync/sw7b-1 branch October 10, 2026 20:14
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 11, 2026
* refactor(plugin-sdk): share legacy persistence warning budgets

* feat(plugin-sdk): add worker-owned keyed state

Plugin state callbacks can perform SQLite work on the Gateway thread, including APIs that return a Promise.

Plugin authors gain a versioned worker-owned keyed store; existing synchronous and callback APIs keep their completion semantics through the current Plugin SDK major.

* test: complete keyed state runtime fixture

* refactor(plugin-state): separate offline migration entrypoints

* test(facetime): bind persistence barriers before runtime startup

* docs: explain validated discussion account config

* fix(clickclack): fence discussion cleanup and reconciliation

* test(clickclack): avoid shadowing store options

* test(plugins): migrate integration fixtures to worker state

* test(facetime): observe deletion before runtime captures store methods

* fix(plugins): capture native session identity before admission awaits

Restore the immediate initial read for ordinary host-owned sessions so the existing admission check rejects replacements made while work is queued. Keep bound incognito reads asynchronous and retain the existing session-replacement regression.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling channel: imessage Channel integration: imessage channel: signal Channel integration: signal channel: zalouser Channel integration: zalouser docs Improvements or additions to documentation extensions: clickclack extensions: crabbox extensions: onepassword 1Password plugin merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. P2 Normal backlog priority with limited blast radius. plugin: facetime FaceTime plugin plugin: file-transfer rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: XL status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant