Skip to content

refactor(cron): move retention cleanup off the Gateway thread - #160858

Merged
steipete merged 12 commits into
mainfrom
codex/cron-lifecycle-worker-20260928
Sep 29, 2026
Merged

steipete merged 12 commits into
mainfrom
codex/cron-lifecycle-worker-20260928

Conversation

@steipete

@steipete steipete commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Cron retention and continuation cleanup still perform database planning and deletion on the Gateway thread, including cold database access. Moving that work exposed two correctness gaps: delayed receipt cleanup could erase a recreated session’s receipts, and native opening could repair an index after the caller revoked authority during integrity validation.

User Impact

File-backed cleanup leaves the event loop available while preserving active descendants, pending media, recent sessions, base transcripts, and native harness ownership. Permanent deletion removes historical and late old-generation publication receipts while preserving a successor’s receipts and replay records. Revoked native opening now unwinds before schema repair.

There is no new configuration, schema, retention contract, SDK option, or protocol version. Ordinary authorized opening retains its existing repair behavior.

Ownership

The existing reclamation worker owns asynchronous planning and synchronous commit. The host retains live admission and original native rollback objects; the worker rereads durable descendant and maintenance facts after the host grants authority. Cold operations retain native database identity without opening a foreground SQLite handle. Confirmed worker results invalidate parent caches and retained facts before observers.

Receipt cleanup captures historical receipt identities before removing the original session. Its final shared-state transaction selects those identities or receipts bound to the exact removed session ID and lifecycle revision. This includes late old-generation inserts without deleting same-ID/new-revision successors. A missing personal lifecycle binding remains distinct from an explicitly absent revision.

Native opening uses the same private integrity generator. Before every synchronous resume, its existing admission owner rechecks the captured lease and original live source; refusal uses the existing unwind path before repair can resume. The synchronous driver now shares the existing admission factory with the other two drivers, preserving the public three-argument function and main-thread maintenance behavior.

Opaque native harness mutations retain their process-held transaction owner. This does not provide cross-database atomicity. Repository-workspace cleanup’s remaining authoritative foreground checks are preserved here and belong to the separately assigned repository-workspaces migration.

Evidence

Current head: 16d75590f497f9099ffd5ada8ba851c21c8c69f7, composed with fixed main b4ae783fbfd2d50307ef9af357ed944120a1824d for an actual conflict.

The regressions exercise the real owners:

  • Original continuation/reaper paths perform foreground SQL; the worker cases verify warm/cold zero-parent-SQL behavior and event-loop progress, including changed descendant facts, late media, and source replacement.
  • The direct receipt case originally deleted a real coordinator-created successor receipt. The repair preserves it while deleting historical and late old-generation receipts. Coordinator, SQLite stores, and workers execute normally; GitHub transport remains the existing synthetic fixture.
  • The native-opening case verifies that the index is absent while real integrity SQL is held. On the original source, revocation followed by release still recreated that index. The repair keeps it absent and preserves the original row, transcript, native handle and lease set while the refused carrier settles.

Final receiving proof passes 74 cases with one Linux-only signal case skipped on macOS. Post-organization native proof passes 70 cases, including environment capture, both Gateway cases, physical/source ownership negatives, integrity, and main-thread prepared-lease maintenance. Integrity-driver/worker siblings pass another 54 cases. Three predetermined plain-source Gateway samples each pass both cases with unchanged source, assertions and deadlines; these are bounded stability results, not a claimed cause for an earlier unexplained RPC timeout.

The complete changed-file gate passes: core types, all 27 core-test type graphs, formatting, line/assertion ratchets, dependency and SDK boundary guards, all three unused-export scans, core/scripts lint, schema/storage guards and runtime cycles. The separate Madge check reports zero cycles. Fresh full-context Codex review found no actionable P0–P2 issue.

Source-bound earlier proof includes 80 receipt/deletion/Cron cases, 24 original-order Codex cases plus 26 SDK cases, and the receiving Doctor/cold-snapshot/migration controls. Test routing now uses the existing broker owners for real deletion consumers; the actual analyzer was checked for 157 named callers/helpers, including former-fast watch admission. Held-response and restart fixtures now control their intended ordering or join the existing work owner; production deadlines and forbidden-effect assertions remain intact.

These are composed results, not one whole-suite run. The full build at 9aabc0b3 passed in 27m17.3s and is reused only for unaffected scope; maintained worker compilation executed the final native source during current proof. No current whole published-driver upgrade comparison or matched before/after throughput claim is made. The Gateway retirement implementation itself is received from canonical #160201; the new opening-authority check is qualified separately above. Earlier failed and cancelled CI runs remain failed/cancelled. Exact-head CI and native admission remain the final landing gates.

Move continuation and reaper planning and ordinary deletion through the
existing reclamation worker while retaining live parent authority and
fresh durable descendant and maintenance checks before commit.

Preserve native mutation custody, cold validation proof, and publication
ordering. Carry session-absence authority through receipt cleanup.

Follow-up to #160508.
@clawsweeper

clawsweeper Bot commented Sep 29, 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 gateway Gateway runtime agents Agent runtime and tooling size: XL labels Sep 29, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 29, 2026
@clawsweeper

clawsweeper Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 29, 2026, 5:01 AM ET / 09:01 UTC (Revision 14).

ClawSweeper review

What this changes

Moves Cron retention and continuation cleanup into SQLite workers, adds live-authority guards for deletion and native opening, and expands regression coverage.

Merge readiness

⛔ Blocked before merge - 4 items remain

Current main still has the foreground cleanup path, so this PR remains useful. The earlier receipt-deletion finding is addressed. The remaining merge blocker is the repository-required upgrade check against existing operator state.

Priority: P2
Reviewed head: 16d75590f497f9099ffd5ada8ba851c21c8c69f7

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) Strong production-boundary regressions support the patch; existing-state updater coverage remains the material gap.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (terminal): The PR body records before-and-after runs through the real Cron cleanup worker, SQLite receipt coordinator, and native-open path; source tests assert zero parent SQL, preserved successor receipts, and no index repair after revocation. This review did not rerun them. No stored-data format change is introduced, so data-model migration proof is not applicable.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (terminal): The PR body records before-and-after runs through the real Cron cleanup worker, SQLite receipt coordinator, and native-open path; source tests assert zero parent SQL, preserved successor receipts, and no index repair after revocation. This review did not rerun them. No stored-data format change is introduced, so data-model migration proof is not applicable.
Evidence reviewed 13 items Current main still uses foreground planning: The current-main lifecycle path enters a local SQLite session database for deletion preparation and again when forming the final reclamation plan.
Introduced Cron worker path: The reaper supplies a prepared descendant basis and a live commit guard to the existing lifecycle mutation owner; continuation cleanup follows the same pattern.
Final worker authorization: The worker request checks its claim and caller before the commit grant, then publishes invalidations only after a completed worker result.
Findings None None.
Security None None.

How this fits together

Cron timers and completed continuations ask the session lifecycle owner to remove old run sessions. That owner coordinates SQLite deletion, transcript archival, cache invalidation, and publication-receipt cleanup.

flowchart LR
A[Cron timer or continuation] --> B[Session lifecycle owner]
B --> C[Worker prepares deletion]
C --> D{Live session and descendant checks}
D -->|Allowed| E[SQLite deletion and archive]
D -->|Refused| F[Preserved session]
E --> G[Cache and receipt publication]
Loading

Before merge

  • Resolve merge risk (P1) - The candidate has not been exercised by a published updater over copied existing operator state, leaving post-update worker admission, session cleanup, and recovery behavior unverified.
  • Complete next step (P2) - Record the repository-required published-updater × candidate run on copied existing operator state before merge.
  • 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

Metric Value Why it matters
Production and test growth production net +1,866 lines; tests net +1,654 lines The production growth is explained by worker planning and admission ownership, while the added tests exercise those boundaries.

Stored data model

Persistent data-model change detected: migration/backfill/repair: src/config/sessions/session-accessor.sqlite-projection-state.ts, migration/backfill/repair: src/config/sessions/session-accessor.sqlite-projection.ts, serialized state: src/agents/subagents/registry/subagent-registry-read-cache.ts, unknown-data-model-change: src/agents/subagents/registry/subagent-registry-read-cache.ts, unknown-truncated-pull-files. Confirm migration or upgrade compatibility proof before merge.

Merge-risk options

Maintainer options:

  1. Prove upgrade behavior (recommended)
    Run a published updater driver against a copy of existing operator state with this candidate, and record startup, cleanup, and recovery outcomes.

Technical review

Best possible solution:

Keep one worker-owned cleanup path that preserves existing retention, transcripts, successor receipts, and native admission across fresh and upgraded installations.

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

Yes. Current-main source identifies the foreground deletion path, and the branch includes production-worker cases for the cleanup and receipt races; I did not execute them in this read-only review.

Is this the best way to solve the issue?

Yes. The branch uses the existing reclamation worker and live-admission owners without adding a competing store or public option; upgrade behavior still needs the required check.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

No label changes.

Label justifications:

  • P2: This addresses a bounded Cron and session-lifecycle reliability problem with direct regression coverage.
  • merge-risk: 🚨 compatibility: Worker-backed cleanup and native opening change service lifecycle behavior, but the required existing-state updater check is absent.
  • merge-risk: 🚨 session-state: Deletion and generation-scoped receipt publication cross SQLite owners, so existing-state behavior matters beyond a clean fresh-store run.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): The PR body records before-and-after runs through the real Cron cleanup worker, SQLite receipt coordinator, and native-open path; source tests assert zero parent SQL, preserved successor receipts, and no index repair after revocation. This review did not rerun them. No stored-data format change is introduced, so data-model migration proof is not applicable.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body records before-and-after runs through the real Cron cleanup worker, SQLite receipt coordinator, and native-open path; source tests assert zero parent SQL, preserved successor receipts, and no index repair after revocation. This review did not rerun them. No stored-data format change is introduced, so data-model migration proof is not applicable.

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)
  • zachisfine: 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.

  • Record the published-driver × candidate result using a copy of existing operator state.

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 (13 earlier review cycles; latest 8 shown)
  • reviewed 2026-09-29T03:37:19.856Z sha 4924458 :: needs real behavior proof before merge. :: [P1] Fence direct receipt deletion to the removed session
  • reviewed 2026-09-29T03:58:59.342Z sha 680d7d9 :: needs real behavior proof before merge. :: [P1] Fence direct receipt deletion to the removed session
  • reviewed 2026-09-29T04:50:20.450Z sha 9aabc0b :: blocked before merge. :: none
  • reviewed 2026-09-29T05:23:52.763Z sha bb702ac :: blocked before merge. :: none
  • reviewed 2026-09-29T06:07:14.763Z sha eeb9307 :: blocked before merge. :: none
  • reviewed 2026-09-29T06:28:45.812Z sha eca528f :: blocked before merge. :: none
  • reviewed 2026-09-29T06:52:07.427Z sha d8d1646 :: blocked before merge. :: none
  • reviewed 2026-09-29T07:14:36.001Z sha 1bc62c8 :: blocked before merge. :: none

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. 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 29, 2026
Resolve the actual fixed-main lifecycle conflicts while preserving shared target
validation and native ownership. Keep the deletion predicate with its planning
owner to remove a runtime import cycle, and make internal declarations private.

Observe native admission in the existing lifecycle tests without injecting test
diagnostics into worker RPC or requiring redundant integrity scans. Preserve
FIFO, live authority, source identity, historical archives, and all assertions.
@steipete
steipete marked this pull request as ready for review September 29, 2026 02:17
@steipete

Copy link
Copy Markdown
Contributor Author

The integrated head is now 87c771a3ba4a4c8579a74a920e1c47ce79d7b8d0, and GitHub reports it mergeable. The unused exports and runtime import cycle are repaired. Fresh independent review is clean through P2; the full receiving build passed, as did all 27 selected test type graphs and the final affected checks.

The final grouped admission/Cron command passed 55 cases in 69.05 seconds; the build's own phase timer reports 5m32s. Earlier source-bound native-route proof passed 216 cases with one existing opt-in benchmark skipped. These are measured command/group results, not standalone single-worker timings or a before/after speed comparison. Maintainer disposition of the timing-only request is to reuse that scoped evidence without rerunning solely to produce a separate timing inventory; standalone per-file cost remains unmeasured.

The data-model checklist is a heuristic mismatch here. This change preserves the stored schema, row representation, archive format, retention policy, and existing transaction kernels. The native schema guard passed at v19. The added planning messages and cache facts are process/worker coordination, while the projection-state extraction moves the existing kernel; no migration or backfill is introduced. The PR body records the remaining repository-workspace foreground checks and the lack of cross-database atomicity.

Exact-head CI is running at https://github.com/openclaw/openclaw/actions/runs/36511885968. Its result remains separate from the scoped proof above.

@clawsweeper clawsweeper Bot added merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed proof: sufficient ClawSweeper judged the real behavior proof convincing. merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 29, 2026
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Sep 29, 2026
@openclaw-barnacle openclaw-barnacle Bot reopened this Sep 29, 2026
steipete added a commit that referenced this pull request Sep 29, 2026
Repair regressions introduced by 26dffe7 (#160858).

Native Incognito deletion must validate the original row before its synchronous
mutation, not reject the row's own removal at commit. Keep configured archive
locations independent of the physical database pinned for worker admission.

Repair worker-consumer fixtures without weakening assertions: pass the board
fixture's state environment, inject rollback TEMP triggers on the deleting
worker connection without altering the admitted schema, use the canonical entry
writer for the cleanup race, and await shared-state retirement before terminating
history-budget workers. No test routing registrations were missing.

Proof: eight listed consumer files (99 tests), cron worker lifecycle (11),
Gateway sessions.delete lifecycle/state (28), and SQLite deletion/admission
siblings (32). Core and affected test types, scoped lint/format, diff checks,
and independent Codex review through P2 pass. No schema, retention, permissions,
or update behavior changes.

Bounded repair gaps: prepared-admission had five failures on main and passed
30/30 at the parent. Its corrected cold integrity probe also blocks an
independent writer FIFO callback; experimental fixture changes are not retained.
First-signin cannot start on either revision because the artifact fence treats
an absent macOS LaunchAgent as unverified when missingUnit is absent. No gate
bypass, live Gateway change, or push was performed.
steipete added a commit that referenced this pull request Sep 29, 2026
* refactor(storage): run repository workspace SQL in workers

Move repository reads and synchronous Kysely mutation kernels to the
existing SQLite workers, and await their actual callers. Publish row changes
from native commit receipts and retain operation custody through cleanup.
Prepared repository facts serve synchronous authorization and event frames.

Revalidate the original physical and logical session source at receipt and
workspace grants, preserving full logical lookup and direct deletion's
historical receipt rules. Remove the obsolete native-handle factory option.
No storage schema, public configuration, permission or retention change.

Current-main proof passes 80 focused SQLite/worker cases and owning types;
qualified receiving adds 198 lifecycle/Gateway cases, all 27 test type graphs,
and 66 repository/checkpoint/publication/file-RPC cases. Source controls
reproduce foreign-write row and receipt loss, and the repaired paths pass.
Independent review is clean through P2. Full build and affected receiving
bundle checks pass with recorded source applicability.

Completes the repository domain cutover after #145048 and #160858.

* fix(gateway): bind prepared events to the current projection

* fix(storage): finish committed repository artifact cleanup

* fix(test): keep Gateway worker paths in canonical order

* test(gateway): align prepared publication fixtures
steipete added a commit that referenced this pull request Sep 29, 2026
…ce (#161181)

* fix(sessions): keep foreground updates responsive during cold maintenance

Prepare the original existing database in the reclamation actor instead of
opening the foreground executor first. Require canonical native validation,
actual identity and lease acceptance before mutation, preserving incoming and
outgoing revocable proof and current-authority checks.

Keep caller refusal separate from source health, join native cleanup on source
retirement, and retain exact cold versus warm lease accounting. Reuse the
original concurrency tests and native admission fixture boundaries.

Node proof covers the original 39-case pair, cold concurrency, validation
reuse, archive/reclamation and Gateway siblings, with affected lease fixtures
verified after accounting for the removed foreground actor. Two preparation
lifetime cases also pass on Bun. Changed gates, all 27 test type graphs and
independent review through P2 pass. The Linux-only managed SIGTERM case was
not run locally. Schemas, retention, permissions and update behavior unchanged.

Related: #160858

* fix(sessions): preserve cold preparation diagnostics

Carry the logical reclamation context through native preparation and observe its real admission releases in the lifetime regression. Keep the foreground proof on the exact-replacement API using the established scoped fixture environment.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 30, 2026
…aw#160858)

* refactor(cron): use database workers for session retention cleanup

Move continuation and reaper planning and ordinary deletion through the
existing reclamation worker while retaining live parent authority and
fresh durable descendant and maintenance checks before commit.

Preserve native mutation custody, cold validation proof, and publication
ordering. Carry session-absence authority through receipt cleanup.

Follow-up to openclaw#160508.

* fix(sessions): keep worker plan contracts independent of implementations

* fix(sessions): preserve SDK deletion state environment

Forward the existing SDK env option through lifecycle source capture,
while excluding it from cloneable deletion plans. Keep the physical
database ownership guard and all existing plugin assertions. Run the
SDK session-store tests in the existing host-broker worker group.

The original six-file Codex group passes all 24 cases, including both
CI failures; all 26 SDK session-store cases also pass. Core types,
scoped lint, SDK exports, line caps, and fresh Codex review pass.

* test(sessions): complete worker cleanup test routing

Route the conversation SDK deletion suite through the existing shared-state
host broker and import the reclamation runtime from its current owner.
Compare the archive destination by physical path on Windows while retaining
transcript contents and exact disk-accounting assertions.

The exact preceding CI exposed all three gaps. Focused runtime and routing
proof passes 504 cases with one Linux-only case skipped locally; affected
types and independent review pass. Windows CI remains platform proof.

* test(sessions): route remaining deletion consumers through broker

Complete the explicit core and plugin worker test registrations for real
permanent-deletion consumers. Preserve all archive and lifecycle assertions.

Control the clock only in the held-response Mattermost identity race:
the real five-second backfill deadline previously settled before cold
worker deletion committed. Keep the separate real deadline test unchanged.

Proof: 19 package cases, 185 unchanged Codex cases and 20 final Mattermost
cases, routing control, extension types, lint and fresh independent review.

* test(subagents): join retained cleanup before restart assertions

Wait for the existing admitted-work fixture to settle before polling row
removal, so asynchronous deletion cannot leave a restart fence contaminating
later cases. Preserve the original assertions, poll and timeout.

Route Feishu Doctor through the existing host broker for real SDK deletion.
Proof: original four-case sequence failed then passed after the one-statement
reorder; all 43 recovery/steer and 19 Feishu cases pass, with affected types,
lint, formatting and fresh independent review.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 30, 2026
Repair regressions introduced by a02ce7b (openclaw#160858).

Native Incognito deletion must validate the original row before its synchronous
mutation, not reject the row's own removal at commit. Keep configured archive
locations independent of the physical database pinned for worker admission.

Repair worker-consumer fixtures without weakening assertions: pass the board
fixture's state environment, inject rollback TEMP triggers on the deleting
worker connection without altering the admitted schema, use the canonical entry
writer for the cleanup race, and await shared-state retirement before terminating
history-budget workers. No test routing registrations were missing.

Proof: eight listed consumer files (99 tests), cron worker lifecycle (11),
Gateway sessions.delete lifecycle/state (28), and SQLite deletion/admission
siblings (32). Core and affected test types, scoped lint/format, diff checks,
and independent Codex review through P2 pass. No schema, retention, permissions,
or update behavior changes.

Bounded repair gaps: prepared-admission had five failures on main and passed
30/30 at the parent. Its corrected cold integrity probe also blocks an
independent writer FIFO callback; experimental fixture changes are not retained.
First-signin cannot start on either revision because the artifact fence treats
an absent macOS LaunchAgent as unverified when missingUnit is absent. No gate
bypass, live Gateway change, or push was performed.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 30, 2026
…161124)

* refactor(storage): run repository workspace SQL in workers

Move repository reads and synchronous Kysely mutation kernels to the
existing SQLite workers, and await their actual callers. Publish row changes
from native commit receipts and retain operation custody through cleanup.
Prepared repository facts serve synchronous authorization and event frames.

Revalidate the original physical and logical session source at receipt and
workspace grants, preserving full logical lookup and direct deletion's
historical receipt rules. Remove the obsolete native-handle factory option.
No storage schema, public configuration, permission or retention change.

Current-main proof passes 80 focused SQLite/worker cases and owning types;
qualified receiving adds 198 lifecycle/Gateway cases, all 27 test type graphs,
and 66 repository/checkpoint/publication/file-RPC cases. Source controls
reproduce foreign-write row and receipt loss, and the repaired paths pass.
Independent review is clean through P2. Full build and affected receiving
bundle checks pass with recorded source applicability.

Completes the repository domain cutover after openclaw#145048 and openclaw#160858.

* fix(gateway): bind prepared events to the current projection

* fix(storage): finish committed repository artifact cleanup

* fix(test): keep Gateway worker paths in canonical order

* test(gateway): align prepared publication fixtures
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 30, 2026
…ce (openclaw#161181)

* fix(sessions): keep foreground updates responsive during cold maintenance

Prepare the original existing database in the reclamation actor instead of
opening the foreground executor first. Require canonical native validation,
actual identity and lease acceptance before mutation, preserving incoming and
outgoing revocable proof and current-authority checks.

Keep caller refusal separate from source health, join native cleanup on source
retirement, and retain exact cold versus warm lease accounting. Reuse the
original concurrency tests and native admission fixture boundaries.

Node proof covers the original 39-case pair, cold concurrency, validation
reuse, archive/reclamation and Gateway siblings, with affected lease fixtures
verified after accounting for the removed foreground actor. Two preparation
lifetime cases also pass on Bun. Changed gates, all 27 test type graphs and
independent review through P2 pass. The Linux-only managed SIGTERM case was
not run locally. Schemas, retention, permissions and update behavior unchanged.

Related: openclaw#160858

* fix(sessions): preserve cold preparation diagnostics

Carry the logical reclamation context through native preparation and observe its real admission releases in the lifetime regression. Keep the foreground proof on the exact-replacement API using the established scoped fixture environment.
steipete added a commit that referenced this pull request Sep 30, 2026
…ns (#161608)

The prepared-admission maintenance probes pre-released every native
integrity check, so they passed even when cold validation ran in the
foreground executor under the writer permit (#160858's shape, repaired by
#161181). Hold the first integrity check on the fixture database in any
worker, assert the reclamation worker owns it, and require a foreground
replacement commit while it is held, for the whole-store, lifecycle and
replacement entry points and the finalizer lifetime recheck.

Keep expired-proof finalization as its own case on the retained branch:
the reclamation worker revalidates before committing while foreground
writes proceed. Existing integrity-counter callers keep their message
shape; the unused before-writer hold mode is removed.

With the executor-first preparation temporarily restored, the four cold
cases fail in about 2 s each on the owner assertion.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 1, 2026
…ns (openclaw#161608)

The prepared-admission maintenance probes pre-released every native
integrity check, so they passed even when cold validation ran in the
foreground executor under the writer permit (openclaw#160858's shape, repaired by
openclaw#161181). Hold the first integrity check on the fixture database in any
worker, assert the reclamation worker owns it, and require a foreground
replacement commit while it is held, for the whole-store, lifecycle and
replacement entry points and the finalizer lifetime recheck.

Keep expired-proof finalization as its own case on the retained branch:
the reclamation worker revalidates before committing while foreground
writes proceed. Existing integrity-counter callers keep their message
shape; the unused before-writer hold mode is removed.

With the executor-first preparation temporarily restored, the four cold
cases fail in about 2 s each on the owner assertion.
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: mattermost Channel integration: mattermost docs Improvements or additions to documentation gateway Gateway runtime 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. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. 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