Skip to content

perf(state): avoid synchronous lease reads during reloads - #183336

Merged
steipete merged 9 commits into
mainfrom
dbasync/reloadlease
Oct 25, 2026
Merged

steipete merged 9 commits into
mainfrom
dbasync/reloadlease

Conversation

@steipete

@steipete steipete commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Config reload and plugin lifecycle callbacks repeatedly query lease ownership on the Gateway main thread, even though the native lease owner already holds the confirmed expiry and lifetime state. The synthetic real-WebSocket comparison reproduces 27 MAIN reads per warm reload and 51 per plugin toggle; the candidate reduces both to zero.

User Impact

Reloads and plugin enable/disable keep their existing results while removing synchronous ownership queries. Explicit durable assertions, worker commit checks, acquisition, renewal, release, maintenance, and lease-loss rejection stay intact. No operator action or schema migration is required.

Why This Change Was Made

Expose the existing owner's current lifetime/expiry fact separately from durable assertOwned(), and carry it through reload checkpoints. Fast implicit entry/return applies only to native, process-bound, non-worker-heartbeat, current-schema invocations. The owner uses the expiry returned by successful persistence and Date.now(); unknown renewal cannot extend it. There is no new cache, generation, fence, handshake, SQL text, or transaction change.

Final effect checks remain. In particular, the outer publication.assertInvokerOwned() is restored immediately before runtime.publish(). A post-await plugin checkpoint also stays because it checks drain, cancellation, and requester state. Accepted edge: arbitrary out-of-band SQL edits during the confirmed lifetime are detected at the next durable assertion/commit; supported live writes have one Gateway owner and offline maintenance requires exclusive custody. Production delta: +33/−23 lines, net +10, accepted by the maintainer.

Evidence

The maintainer accepted the count-regression tradeoff; final exact-head CI passed. The third pair triggered the preregistered stop: warm request p95 26 → 32 (+23.1%). This is not described as passing or hidden within spread. All three pairs have zero candidate runtime MAIN SQL. The final test-only CI correction adds the required isolation explanation to a test mock and prunes its obsolete baseline entry; the mock-export guard passes with 7,013 grandfathered factories. It changes no production behavior.

Preregistered acceptance

Flow: isolated current-head Gateway with its own synthetic config, workspace, state and loopback port; token-authenticated config.get/config.set; hybrid reload strategy with the normal debounce; six hot-compatible config changes (first cold, five warm), bundled Diffs enable/disable, then one connected idle minute. config.set persistence is followed by config.get until its raw revision matches that exact write acknowledgement and its applied revision matches the persisted resolved revision. No operator data or external provider is used.

Workload: node --import ./scripts/tsx.mjs scripts/bench-reload-lease.mts --out <fresh-internal-dir> --observer <frozen-v3.1.5>/observer.cjs --samples 6 --idle-seconds 60 --cpu-profile, with the frozen causality preload, internal temporary/cache roots, and ordinary proof slot. First run without --cpu-profile for counts, then repeat with the flag for per-thread profiles. Capture native SQL, worker requests and MAIN statements. Each action cell includes its following one-second settle phase so post-publication cleanup cannot disappear from the counts. Attribute every MAIN state_leases shape to its caller and protected effect; report repeated checkpoints separately from actual effects.

Acceptance for a production candidate: MAIN lease SELECTs must reach zero throughout reload/plugin/idle, or every retained statement must have a documented effect and reason. Total SQL and requests for touched operations must fall or hold, warm non-regression must hold, and existing lease-loss tests must still stop publication/activation/restart. No new generations, fences, freshness probes, schemas or caches. Moving a kept check to the worker alone is not a total-work saving.

Comparison: same-platform alternating M/C pairs, three pairs when campaign load/disk gates allow; otherwise one pair with explicit source attribution. At least five warm action samples per arm; cold, warm, plugin and idle cells reported separately as median/p95/min/max, with per-operation deltas. Timing/CPU-speed A/B requires the timing mkdir lock and load below 24, five samples per arm, no worse user-facing metric; any adverse 20% cell stops. Under load, counts/profiles only, no latency or CPU-speed claim.

Completed three-pair comparison

Production base bac203a331efd320a9441d9e1e4c83dfa6517352, candidate a0b8c1c3e3426612bddaa18d050643daaafeeff7. Same platform, M/C/M/C/M/C, frozen observer v3.1.5 (37 hashes verified), six config changes, plugin enable/disable, connected idle minute. Each action includes completed owner releases and its one-second settle; all requested persisted/applied revisions completed and observer errors were zero. The saved first baseline arm was reused; no baseline rebuild. Starting load was 33.08, so these are counts, not latency/CPU-speed evidence.

Cells show median [min–max], p95. Cold and warm remain separate.

Cell SQL: base → candidate Requests: base → candidate MAIN: base → candidate
First reload (3/arm) 100 [88–117], p95 117 → 86 [70–90], p95 90 31 [29–37], p95 37 → 35 [31–37], p95 37 27 [24–27], p95 27 → 0 [0–0], p95 0
Warm reload (15/arm) 85 [84–86], p95 86 → 58 [57–73], p95 73 25 [25–26], p95 26 → 25 [25–32], p95 32 27 [27–27], p95 27 → 0 [0–0], p95 0
Plugin enable (3/arm) 106 [105–106], p95 106 → 54 [51–55], p95 55 26 [26–27], p95 27 → 26 [25–26], p95 26 51 [51–51], p95 51 → 0 [0–0], p95 0
Plugin disable (3/arm) 106 [104–106], p95 106 → 55 [55–55], p95 55 26 [26–27], p95 27 → 27 [27–27], p95 27 51 [51–51], p95 51 → 0 [0–0], p95 0
Idle minute (3/arm) 20 [20–20], p95 20 → 20 [20–20], p95 20 8 [8–8], p95 8 → 8 [7–8], p95 8 0 [0–0], p95 0 → 0 [0–0], p95 0
Whole run (3/arm) 1602 [1600–1612], p95 1612 → 1340 [1339–1365], p95 1365 359 [358–365], p95 365 → 358 [357–372], p95 372 333 [330–334], p95 334 → 70 [69–70], p95 70

The 15 warm MAIN counts are exactly 27 → 0; all six plugin-toggle comparisons are 51 → 0. Candidate MAIN remains only during boot (64–65, including one lease SELECT) and shutdown (5); runtime reload/plugin/idle MAIN is zero. Idle MAIN was already zero on the reproduced baseline, so no idle saving is claimed.

The third pair's first warm cell adds three execute requests, two plugin metadata reads, one usage-cost refresh and one memory prewarm, minus one periodic scan. Stacks identify one extra acquisition, one snapshot application and one lower-level broker operation among the executes; the extra reload-scope work is explicitly included, not dismissed as generic noise. Later warm cells include catalog/deferred-migration and deletion/topology readers. Third-pair whole requests rise 359 → 372; pooled whole medians are 359 → 358. The maintainer accepted this attributed overlap after the stop. An additional check of the existing ledgers finds two acquisition requests in every baseline warm sample; the candidate has two in 14/15 and three only in the spiking sample. All plugin actions have two on both arms. Cold acquisition requests match per pair (2/2/3). This is not a per-reload increase. The isolated extra scope remains a named follow-up; all its work stays included in the table. No repeated runs were used to chase the spike away.

A separate candidate attribution run used the existing measured build and captured 30 thread CPU profiles with zero observer errors. Lease-verification samples were confined to a worker profile (four inclusive samples); MAIN had zero. The earlier baseline attribution covered 32 threads. These are profile attributions under load, not a matched CPU-speed comparison.

Behavior, reviews, and CI

The no-MAIN regression is red on the base ([0,1]) and green on the candidate ([0,0]). Native admission 10/10 and seven reload/plugin owner files 454/454 pass on the final production source. Explicit SQLite and PostgreSQL durable lease-loss cases also pass. The worker TIMER observation test was already green before the correction; the genuine red/green regression captures the direct native checkpoint's cancellation error outside final unwind normalization.

Two isolated Codex production reviews and the permitted focused CI/PG correction reviews are scoped-clean. The final PG delta restores assertActive() and the outer invoker check. PG approval carries for these precise changes; exact-head CI run 40177729778 completed successfully, including all three PostgreSQL conformance shards, types, lint, architecture, source contracts, baseline ratchets, and the aggregate CI gate. Final head 217b048e5bb21e9e75d6483b8cef573959c61739 adds only the mock-isolation explanation and shrink-only baseline bookkeeping; all production and benchmark blobs are identical to the measured a0b8c1c3e34. On a0b8c1c3e34, the only observed static failure was the new test mock's missing isolation explanation. The final test-only commit fixes it and shrinks the obsolete baseline entry; the local mock-export guard and formatting checks pass. Local script types were blocked before the compiler by the mandated internal virtual-store containment check; passing CI types provide that proof. Targeted type-aware lint, formatting, and diff checks pass.

The final shared PR index audit on 217b048e5bb2 covers 66 peers. Sixty-four have identical conflict paths/regions. The maintainer accepted the test-only mock/import overlap with #183279, its required one-line obsolete baseline-row deletion, and the required fixture capability inside #161900's existing add/add conflict. The two newly indexed PRs (#183443 and #183445) and updated #183248 remain conflict-free. No new production conflicts.

The final canonical Knip scan exits 1 with 26 script, 20 production, and 16 full-tree occurrences. Every finding and all scanner/config/package inputs are byte-identical to the PR merge base and outside the changed files. The maintainer accepted them as inherited; retained lease helpers still have live consumers, and this change removes no helper's last use. This is attributed inherited debt, not a clean Knip result.

Final head 217b048e5bb21e9e75d6483b8cef573959c61739 has a successful openclaw/ci-gate; security and dependency review also passed. The final shared-index refresh still contains the same 66 peer heads and adds no conflict delta.

The maintainer waived the published-driver update cell: no persisted schema, format, config, migration, update command, or Doctor behavior changes. The queued Testbox attempt was canceled and verified completed with no host; it is not claimed as passing proof.

@clawsweeper

clawsweeper Bot commented Oct 25, 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 scripts Repository scripts size: M labels Oct 25, 2026
Reuse the process-bound native lease owner’s confirmed expiry and lifetime at reload and plugin checkpoints. Keep explicit durable assertions, maintenance, renewal and worker commit authority intact. This removes repeated main-thread ownership reads without a schema or lease SQL change.
@openclaw-barnacle openclaw-barnacle Bot added the gateway Gateway runtime label Oct 25, 2026
@steipete
steipete marked this pull request as ready for review October 25, 2026 07:04
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-25T08:16:59.174021Z a0b8c1c New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. labels Oct 25, 2026
@clawsweeper

clawsweeper Bot commented Oct 25, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge.

What this changes

Adds a real-Gateway reload benchmark and carries the native lease owner's lifetime and confirmed expiry through reload checkpoints.

Example: Change messages.ackReaction to 🧪 through config.set.

  • Before: The recorded baseline reports a median of 27 main-thread lease reads per warm reload.
  • After: Process-bound reload checkpoints consult the existing owner in memory; the candidate's end-to-end read count remains unmeasured.

Review scores

Measure Result What it means
Overall readiness 🧂 unranked krab (1/6) The useful owner-based optimization has two concrete introduced defects, and the changed authority boundary lacks candidate final-effect proof.
Proof confidence 🧂 unranked krab (1/6) Real behavior proof is necessary before merge. See Before merge.
Patch quality 🦪 silver shellfish (2/6) Security review found an item that needs attention.

Product

Kind: Performance · Worth it: Yes · Fix scope: Complete
User problem: Configuration reloads and plugin lifecycle work repeatedly query lease ownership on the Gateway thread.
Reason: The maintainer-authored direction addresses measured work using the existing owner and explicitly accepts the bounded external-edit tradeoff.

Merge readiness

⛔ Blocked before merge - 6 items remain

Keep this PR open: it addresses measured reload overhead, but adds synchronous SQL to existing plugin worker checkpoints and breaks an affected reload test fixture.

Priority: P2
Reviewed head: 7957151d0bdc689f90841bfbe011e9fa0a119e93

Before merge

  • Add real behavior proof - Authority-chain proof required: the body records a real isolated Gateway baseline, but candidate results are explicitly pending; the new expiry/revocation tests call a synthetic publication function rather than the actual configuration, plugin activation, or restart effect owners, so they do not establish final-effect refusal after awaited work on SQLite and PostgreSQL. After adding proof, update the PR body, then request a new review with @clawsweeper re-review. The PR author or someone with repository write access can request it.
  • Preserve SQL-free plugin worker checkpoints (P2) - For an ordinary withPluginLifecycleLease({ env }, ...) call, processBound defaults to false, so the new native assertCurrent resolves to assertOperationOwned. Delegating the existing plugin checkpoint to it makes runLeasedIndexWorkerOperation issue synchronous state_leases SELECTs during preparation and worker authority checks. Exact-head CI confirms this in plugin-metadata-state-worker.test.ts and installed-plugin-index-store-write.receipt.test.ts. Preserve the existing SQL-free worker checkpoint semantics while applying the owner-current optimization to the intended reload path; keep durable verification at its existing effect boundaries.
  • Update the affected reload lease test double (P2) - The reload callback now requires assertCurrent, but session-row-projection.config-commits.test.ts still supplies a lease containing only assertOwned. Its first watched config change now fails with TypeError: lease.assertCurrent is not a function instead of exercising projection-neutral reload behavior, as exact-head CI confirms. Update this fixture and audit the other capability producers as part of the interface cutover.
  • Resolve security review attention item - Final-effect refusal remains unproven for the changed lease capability, although source inspection establishes no concrete authorization bypass.
  • Resolve merge risk - Before merge, the PR owner must demonstrate that revoked or expired reload capabilities cannot publish configuration, activate plugins, or request a restart through the production owners on SQLite and PostgreSQL.
  • Explain or restore the original intent of Plugin worker checkpoint semantics - f4cb17e: Plugin index work moved off the Gateway thread while lightweight host checkpoints retained live authority; the new durable fallback adds SQL to those checkpoints without explaining this expansion.

Findings

  • [P2] Preserve SQL-free plugin worker checkpoints — src/plugins/plugin-lifecycle-lease.ts:52
  • [P2] Update the affected reload lease test double — src/gateway/config-reload.ts:1020

Provenance

  • Plugin worker checkpoint semantics changes intended behavior without addressing why it exists (f4cb17e: Plugin index work moved off the Gateway thread while lightweight host checkpoints retained live authority; the new durable fallback adds SQL to those checkpoints without explaining this expansion.)

Tests

  • Missing end-to-end proof: Supply the candidate Gateway comparison and final-effect revocation/expiry refusal evidence on SQLite and PostgreSQL; base-red/head-green execution of the changed regression is not yet recorded.
Agent review details

How this fits together

Authenticated configuration writes and file observations enter the Gateway reload coordinator, which uses plugin lifecycle leases to prepare and publish configuration, credentials, and plugin generations.

flowchart LR
  A[Config RPC or file observation] --> B[Gateway reload coordinator]
  B --> C[Plugin lifecycle lease]
  C --> D[Native lease owner]
  D --> E[Durable lease storage]
  C --> F[Config and plugin publication]
Loading

Technical review

Best possible solution:

Reuse the existing lease owner while preserving SQL-free plugin worker checkpoints, completing the consumer cutover, and qualifying the changed publication boundary.

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

Source inspection and the recorded Gateway baseline establish repeated lease SELECTs; exact-head CI independently exposes the introduced worker-checkpoint SQL and missing test capability.

Is this the best way to solve the issue?

Carrying the existing owner's recorded lifetime is a focused approach, but its shared checkpoint must preserve existing SQL-free worker behavior.

Full review comments:

  • [P2] Preserve SQL-free plugin worker checkpoints — src/plugins/plugin-lifecycle-lease.ts:52
    For an ordinary withPluginLifecycleLease({ env }, ...) call, processBound defaults to false, so the new native assertCurrent resolves to assertOperationOwned. Delegating the existing plugin checkpoint to it makes runLeasedIndexWorkerOperation issue synchronous state_leases SELECTs during preparation and worker authority checks. Exact-head CI confirms this in plugin-metadata-state-worker.test.ts and installed-plugin-index-store-write.receipt.test.ts. Preserve the existing SQL-free worker checkpoint semantics while applying the owner-current optimization to the intended reload path; keep durable verification at its existing effect boundaries.
    Confidence: 0.99
  • [P2] Update the affected reload lease test double — src/gateway/config-reload.ts:1020
    The reload callback now requires assertCurrent, but session-row-projection.config-commits.test.ts still supplies a lease containing only assertOwned. Its first watched config change now fails with TypeError: lease.assertCurrent is not a function instead of exercising projection-neutral reload behavior, as exact-head CI confirms. Update this fixture and audit the other capability producers as part of the interface cutover.
    Confidence: 1

Overall correctness: patch is incorrect
Overall confidence: 0.97

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 0eb9d17cee48.

Merge-risk options

Maintainer options:

  1. Qualify the retained authority boundary (recommended)
    The PR owner should exercise successful publication and refusal after requester revocation or confirmed expiry through the actual reload and plugin publication owners on both database engines.
  2. Pause the production change
    Keep the benchmark work available while deferring the lease-check substitution until its authority behavior is demonstrated.

Provenance checked

  • Native lease callback admission and completion changes intended behavior with a stated reason (65bc5f6: Worker-backed lease lifecycle work retained durable ownership and settlement boundaries; the PR deliberately substitutes owner-current checks for process-bound native timer callbacks.)
  • Transactional config and plugin publication keeps the original intent (b5134de: One Gateway-owned prepare, drain, publish, and retire lifecycle preserves coherent runtime generations; the delegated runtime publish callback retains its final authority assertion.)

Testing

Proof path: in-process harness.

Security

Needs attention: Final-effect refusal remains unproven for the changed lease capability, although source inspection establishes no concrete authorization bypass.

Evidence

What I checked:

  • Pinned production change: The introduced diff replaces reload durable checks with assertCurrent and changes the shared plugin checkpoint to delegate to that new native capability; current main retains the original implementations. (src/plugins/plugin-lifecycle-lease.ts:52, 7957151d0bdc)
  • Introduced plugin worker SQL: Default native lifecycle leases select assertOperationOwned as assertCurrent. Existing index mutation callers invoke this checkpoint around worker work. Exact-head CI records unexpected main-thread state_leases SELECTs in plugin-metadata-state-worker.test.ts and installed-plugin-index-store-write.receipt.test.ts. (src/state/openclaw-state-lease.ts:549, 7957151d0bdc)
  • Incomplete consumer cutover: The projection reload fixture supplies only assertOwned; the new reload call fails with TypeError: lease.assertCurrent is not a function in exact-head CI. (src/gateway/session-row-projection.config-commits.test.ts:27, 7957151d0bdc)
  • Maintainer direction and proof scope: The maintainer-authored body accepts owner-current checks and delayed detection of arbitrary out-of-band SQL edits, while explicitly describing candidate counts as expected rather than measured and PostgreSQL qualification as pending; the discussion supplies no later candidate proof. (7957151d0bdc)
  • Final publication owner retained: The plugin runtime publish callback still checks drain cancellation, requester authority, and reload currency before publishing its registry and metadata. (src/gateway/server-plugin-reload.ts:393, 7957151d0bdc)
  • Existing worker checkpoint contract: The database guidance requires worker-owned runtime SQL and documents index mutation transport checkpoints as retained lease liveness checks; the base plugin checkpoint explicitly promises no synchronous lease SQL inside worker admission. Public docs: docs/reference/database-schemas/worker-access.md. (docs/reference/database-schemas/worker-access.md:4228, 7957151d0bdc)

Likely related people:

  • Peter Steinberger: Raw commit 40d735e adds src/plugins/plugin-lifecycle-lease.ts:34 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 40d735e451b1; files: src/plugins/plugin-lifecycle-lease.ts)
  • Vincent Koc: Raw commit 3ca2b4e adds src/plugins/plugin-lifecycle-lease.ts:43 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 3ca2b4e370a9; files: src/plugins/plugin-lifecycle-lease.ts)

PR surface

Source +10, Tests +77, Other +271. Total +358 across 13 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 7 31 21 +10
Tests 5 87 10 +77
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 271 0 +271
Total 13 389 31 +358

Review metrics

Metric Value Why it matters
Production versus test/support LOC Production +31/-21; tests and benchmark +358/-10. Runtime growth reuses the existing owner; most additions provide the rerunnable Gateway benchmark.

Labels

Label changes:

  • add P2: The optimization addresses measured reload overhead, with a bounded introduced plugin checkpoint regression and an incomplete test-consumer cutover.
  • add merge-risk: 🚨 security-boundary: Reload publication now consumes an owner-current capability instead of repeated durable checks, requiring final-effect refusal evidence; the maintainer has already accepted delayed detection of arbitrary out-of-band SQL edits.
  • add rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🦪 silver shellfish.
  • add status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Label justifications:

  • P2: The optimization addresses measured reload overhead, with a bounded introduced plugin checkpoint regression and an incomplete test-consumer cutover.
  • merge-risk: 🚨 security-boundary: Reload publication now consumes an owner-current capability instead of repeated durable checks, requiring final-effect refusal evidence; the maintainer has already accepted delayed detection of arbitrary out-of-band SQL edits.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🦪 silver shellfish.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Rating scale

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

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed October 25, 2026, 3:22 AM ET / 07:22 UTC.

@openclaw-barnacle openclaw-barnacle Bot added the cli CLI command changes label Oct 25, 2026
@steipete steipete changed the title test(perf): reproduce config reload lease reads perf(state): avoid synchronous lease reads during reloads Oct 25, 2026
@steipete
steipete merged commit f738523 into main Oct 25, 2026
155 of 157 checks passed
@steipete
steipete deleted the dbasync/reloadlease branch October 25, 2026 09:14
scribe-dandelion-cult added a commit to karmaterminal/openclaw that referenced this pull request Oct 25, 2026
Three fork test files merged cleanly but broke against seams upstream
changed in the jump window:

- session-recipient-authority.caller-thread: the maintenance owner fixture
  now provides assertCurrent, which OpenClawStateLeaseContext requires since
  openclaw#183336 (tsgo:core:test TS2741 at the merge).
- session-delivery-queue-runtime: upstream removed withRuntime and builds the
  runtime fixture through withSessionDeliveryQueue (openclaw#183214). The capacity
  retry case does the same: each bound still gets a fresh queue and clock,
  with the same teardown order. The clock-jump case takes upstream's
  r.start() back: the wake assertion that the fork's pendingSweep: false
  served was removed upstream.
- diagnostic.continuation-queue: upstream dropped the startDiagnosticHeartbeat
  test-support export (openclaw#183134); the enabled-config variant is the same
  call.

RED at the merge 86ed749: withRuntime is not defined;
startDiagnosticHeartbeatForTest is not a function; TS2741. GREEN: 20/20,
2/2, 9/9 solo, and tsgo:core:test passes. Assertions are unchanged.

Refs karmaterminal/openclaw-bootstrap#1727

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 26, 2026
…83336)

Reuse the native lease owner's confirmed lifetime at config reload and plugin checkpoints while preserving durable assertions, worker commit checks, and the final invoker validation before publication.

Synthetic real-Gateway comparisons reduce warm MAIN lease reads from 27 to 0 (total SQL 85 to 58), and plugin-toggle MAIN reads from 51 to 0. The measured request-p95 increase from 26 to 32 was accepted after attribution; whole-workload request medians remain 359 to 358. Explicit lease-loss and cancellation coverage remains.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli CLI command changes gateway Gateway runtime merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. P2 Normal backlog priority with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. scripts Repository scripts size: L 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