Skip to content

perf(sqlite): reuse admitted schema catalog facts - #166102

Merged
steipete merged 5 commits into
mainfrom
dbasync/sqlopt-schema
Oct 6, 2026
Merged

steipete merged 5 commits into
mainfrom
dbasync/sqlopt-schema

Conversation

@steipete

@steipete steipete commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Agent operations repeatedly scan canonical trigger definitions and execute first-use schema DDL even when the connection already has admitted schema facts. Separate caller-maintained committed flags duplicate the schema owner's lifecycle and can miss rollback, foreign DDL, and handle replacement.

Solution

Collect index names and trigger definitions in the existing admitted catalog snapshot, consume that snapshot for canonical validation, and use it to decide whether the complete outbox, participant, archive, and node-turn object groups exist. Remove the superseded committed-flag bookkeeping. Retire admitted metadata on native database disposal so closed readers release their catalog references immediately. Facts gathered in managed operations survive ordinary data-only transaction settlement; DDL, rollback, snapshot retirement, and explicit schema publication still invalidate them.

Build on the landed cold-admission owner (#165680). Carry the new facts through its worker receipt transfer and advance local derived-fact revisions when a retained handle adopts a changed schema. The integration regression reproduced stale owner-column availability before that repair.

Impact

Fewer SQLite statements without a new cache, worker service, schema, index, retention policy, durability change, or released SDK contract. Foreign commits remain visible on the next unpinned use; active snapshots, transaction admission, current authority, FIFO, and accepted-write settlement retain their existing owners. Raw maintenance and dynamic-authorizer handles retain native checks. No configuration or update migration is required.

Production: +155 / −102 / net +53 lines, 12 production files; 18 files total. No new OPENCLAW_* names. This is one bounded contribution to the SQL-efficiency campaign; remaining statements still exceed its overall target.

Evidence

Same restored counting harness and fixed synthetic workload, three fresh runs per revision on the same isolated Linux host (8 vCPU, Node 24.21.0); ten warmed turns per run. Source: 7b9405e22d7b0bbbdde1537c2a566521bed425aa → 1a2d1b11cbd61532e17444d69ba1bf9dd40b10b9. Both sides include cold admission. The remote candidate SHA and all 17 changed-file hashes were verified, and the harness hashes match. These are execution counts, not uninstrumented latency measurements.

Statements (three-run medians) Before After Change
All threads, warmed turn 3,180.0 3,114.1 −65.9 (−2.1%)
All threads, first turn 7,087 6,739 −348
All threads, compaction 1,410 1,407 −3
Gateway main thread, warmed turn 3.0 3.0 0

Warmed ranges: 3,179.3–3,182.9 → 3,096.8–3,115.4. Compaction is effectively unchanged. All six runs completed 13 top-level turns, the native child, control-plane RPCs, cron, committed compaction, and graceful shutdown. No SQL failures or fixture children remained. Main/worker calibration on both revisions: eight native calls, two prepares, seven executed statements, zero failures. CPU idle before each run was 99.2–100%.

Targeted and retained probes per warmed turn
Executed statement class Before After
Canonical trigger definition scan 69.8 0.2
Admitted catalog scan 73.8 73.8
All sqlite_schema/sqlite_master references 272.6 203.0
PRAGMA user_version 214.3 214.6
PRAGMA schema_version 140.6 140.8
schema_meta role/version/agent lookup 128.4 128.3
Quarantine lookup by path 74.8 74.8
pragma_table_info(...) 39.2 39.0
PRAGMA table_info 17.2 17.0
PRAGMA page_size 0.0 0.0
TEMP session-node generation read 23.4 22.9
All CREATE statements 10.2 10.2
PRAGMA data_version 573.4 573.9

The broader catalog row includes the two catalog classes above. Residual canonical scans initialize the process-local comparison schema. Target-owner CREATE statements on the first turn fall 38 → 37; their warmed count is zero on both revisions. The remaining warmed CREATE work mostly belongs to standing-intent initialization. The outbox regression independently proves no redundant DDL/catalog reads on newly admitted existing schemas or after first-use installation.

  • Focused integration: 125 tests in six files passed, pnpm test <files> --maxWorkers=1, 726.28 s wall on the loaded Mac. Three sibling files added 45 passing tests in 128.43 s remotely. Total: 170 focused tests across nine files.
  • Explicit runtime process build graph and get-reply import closure: 11 tests passed; shared-state worker and session-history import closures: four tests passed in 43.49 s after moving off the quota-limited filesystem. Total: 15 import/build-closure tests. All focused invocations use --maxWorkers=1.
  • node scripts/check-changed.mjs: 2,063.87 s, passed formatting, policy guards, core typechecking and all 27 test graphs, then stopped at the inherited dead-export findings detailed below. All nine subsequent selected checks were run separately and passed; typed lint reports zero warnings/errors.
  • pnpm deadcode:knip: passed, 54.26 s. Madge: zero cycles, 34.03 s. Runtime import cycles: zero, 19.49 s. Database-worker ratchet: passed, 5.25 s; static T1 846 → 846. No new OPENCLAW_* names.
  • Codex P2 autoreview: scoped-clean, no accepted/actionable findings, against the pinned main base and final source.
  • SDK diff: the only declaration delta adds indexes and triggers to the unreleased cold-admission receipt's SqliteSchemaFacts. It changes 131 reachable declaration fingerprints, with zero direct SDK export signature or entrypoint changes. Reviewed digest 53ad4c98; acknowledged run: 274.85 s. The integrity-verified published 2026.9.8 tarball has 504 declaration files; none contains SqliteSchemaFacts or an import of that module, so the released SDK contract is unchanged.
  • Full package build and tarball integrity/import-graph checks: passed, 748.38 s. Published-driver update cell: passed, 486.38 s, driver 2026.9.8 → exact candidate 1a2d1b11cbd61532e17444d69ba1bf9dd40b10b9; phase finished, readiness HTTP 200, running version verified, durable history preserved, incognito cleared, service replacement verified.

The slower existing outbox and worker-admission suites exercise native worker transport, schema repair/reopening, integrity refusal, and write settlement. Their assertions were extended without adding new per-test Gateway boots or timers. New column-adoption coverage is a native foreign-commit/adoption regression. CI seconds are not available before PR creation.

The adoption and transfer regressions failed for their intended reasons before the fixes. Earlier red controls also demonstrated redundant canonical catalog reads, redundant admitted outbox DDL, and catalog rescans after lazy installation. Existing boundary assertions retain zero host catalog/integrity scans during worker admission. New/changed coverage includes foreign commits, pinned snapshots, local DDL, rollback, eviction/reopening, schema repair, receipt transfer, and dynamic authorizers.

No new/extracted wrapper module or runtime owner cutover was introduced. Import/build-closure tests are included explicitly. Column probes remain native because unqualified SQLite table lookup can select TEMP objects and excludes generated columns; parsing main-schema SQL would not preserve that contract. TEMP generation reads remain data-mutation witnesses.

Known inherited check failure: node scripts/check-changed.mjs --base 7b9405e22d7b0bbbdde1537c2a566521bed425aa --head 1a2d1b11cbd61532e17444d69ba1bf9dd40b10b9 passed core typechecking and all 27 test graphs, then failed the dead-export scan on two untouched exports: OUTBOUND_GREETING_FALLBACK_MS in extensions/voice-call/src/webhook/realtime-call-session-control.ts and loadManifestModelCatalog in src/agents/model-catalog.runtime.ts. The exact same production/full-tree findings reproduce on the pinned base after its QA build (94.49 s). The failure is retained in the evidence; the checks selected after that failure are run separately without disabling the export guard.

The first fresh VM lacked ripgrep, then exhausted its /tmp user quota. Completed proof was preserved; unfinished checks moved to a fresh disk-backed checkout of the same SHA.

Overlap: cold admission is integrated; related wave work includes #165552, #165885, #165895, #165890, #165901, #165859, #165894, #165904, and #165921. The umbrella design draft #162433 is not adopted. This PR keeps its changes within schema-fact ownership; the other SQL-efficiency lanes retain their own query, transaction, and session-cache changes.

Landing integration and CI repair

Integrated the landed session-reader and admission-envelope siblings through a merge commit, 6db8c8314268e0c34a3b90b9b44b95467597cdda, based on main 05179a73d12b46bfc3208d26b939d0bd467d6ca7. No rebase or schema-contract change was needed.

The original CI attempt exposed a PR-caused worker OOM in src/commands/doctor-session-canonical-keys.scale.test.ts; its aggregate gate failed and fail-fast canceled 54 sibling jobs. This was not treated as inherited or flaky. With the file run singly under pinned Linux Bun and --maxWorkers=1, the original PR failed 5/5, its merge base passed 5/5, and the exact CI main parent passed 5/5.

The admitted-metadata WeakMap retained each closed reader's expanded catalog while reader WeakRefs kept those keys alive through the archive worker's microtask drain. Synchronous diagnostics captured 8,192 empty materializations, balanced reader closes, and sampled peak worker heap of 579,598,972 bytes before the OOM. The repair deletes the cache entry through the existing native close/replacement callback. The same instrumented flow passed with sampled peak heap 159,021,730 bytes. Five uninstrumented replays of the original head plus only this repair all passed (wrapper wall times 52, 36, 30, 43, 43 s), preserving the test's 12,000 removals and 200,000 transcript events. No test assertion, memory limit, runtime scheduling, or admission check was changed. The callback performs no SQL.

Final integrated local proof: 154 tests across 10 files passed in 715.41 s after main integration; 63 targeted metadata/archive/import tests across five files passed in 285.59 s after the repair. Both invocations used --maxWorkers=1. Core typechecking passed after integration and again on the final repair (15.39 s); all 27 core-test typecheck graphs passed (828.43 s); Madge found zero cycles (126.29 s). Fresh Codex P2 autoreview of the final staged tree is scoped-clean. The integrated SDK comparison passed in 985.21 s, with reviewed digest 45aa2a77: the same two unreleased catalog fields affect 131 reachable fingerprints, with zero direct export signature or entrypoint changes. Earlier package/update evidence remains explicitly tied to its recorded head.

The original body-format check was also repaired by using the required problem heading; its replacement check passed. The earlier ClawSweeper exact-head review had no actionable code/security finding; its generic stored-model checklist was satisfied by the existing unchanged-DDL and published-driver evidence. A fresh review is requested for the replacement head.

The shared-harness statement comparison above remains 3,180.0 → 3,114.1 warmed all-thread statements on its recorded revisions. The disposal repair adds zero SQL; it changes cache cleanup only. This lane is a bounded reduction toward the campaign target, not a claim that the overall workload is below 500 statements.

CI follow-up b12b0a23cc8bc5578c6712c6c1682b07d4d32a50 fixes the Kysely guard's recognition of the existing raw-schema rationale: formatting had placed its comment inside a ternary, detached from the call. The rationale now sits on the guarded call. pnpm lint:kysely passed (544.19 s) and fresh P2 autoreview is scoped-clean. The correction emits byte-identical JavaScript, so the runtime and integrated SDK proof remains applicable. The preceding CI attempt had only that guard root failure plus its aggregate failure; 53 jobs were canceled. Final-head CI attempt 37493768427 passed: 76 successful jobs, 24 skipped, no failures or cancellations, including the enforced CI gate and corrected architecture guard. ClawSweeper completed the final head at 2026-10-06 16:17 UTC with no actionable correctness/security findings; its detailed verdict explicitly confirms that the generic migration-proof warning is inapplicable to these unchanged persisted schemas and formats. Neither PR-caused failure uses an inherited-failure exception.

Carry index names and trigger definitions in the existing admitted catalog snapshot. Reuse those facts for canonical session validation and first-use schema installation, removing separate committed-schema caches while preserving foreign changes, rollback, reopen, and dynamic authorizer checks.
Keep schema facts collected under synchronous read admission after data-only transaction settlement. Unmanaged snapshots and sibling schema publications observed in a transaction still expire, and the next operation still checks foreign commits. Cover warm worker commands after lazy schema installation.
@clawsweeper

clawsweeper Bot commented Oct 6, 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 agents Agent runtime and tooling size: L labels Oct 6, 2026
@steipete

steipete commented Oct 6, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added 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. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Oct 6, 2026
@clawsweeper

clawsweeper Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed October 6, 2026, 12:46 PM ET / 16:46 UTC (Revision 4).

ClawSweeper review

What this changes

Reuse connection-owned SQLite catalog facts for schema validation and lazy installation, and release retained metadata when database handles close or are replaced.

Warning

SQLite table change

This PR modifies persisted SQLite tables in src/infra/sqlite-schema-ensure.ts, src/infra/sqlite-schema-facts.ts, src/state/openclaw-agent-context-engine-turn-outbox-schema.ts, src/state/openclaw-agent-session-transcript-archive-schema.ts. Prefer a design that avoids changing persisted SQLite tables. If the change is necessary, verify migration and upgrade compatibility against an existing database before merge.

Merge readiness

⛔ Blocked before merge - 1 item remains

The PR remains useful and has no actionable correctness or security findings. The previous migration-proof blocker is inapplicable because persisted schemas and formats are unchanged.

Likely related people: steipete, with high-confidence routing from merged SQLite ownership work.

Priority: P2
Reviewed head: b12b0a23cc8bc5578c6712c6c1682b07d4d32a50

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, well-supported optimization with meaningful native regressions and no remaining actionable blocker.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (live_output): The captured proof exercises production SQLite admission and catalog reuse through isolated Linux agent turns, compaction, and shutdown, with observed statement-count reduction. Native scale controls separately exercise the metadata-disposal repair and show recovery from the introduced OOM. Final-head changes only attach the existing rationale to its guarded call. No stored-data contract changes, so the previous migration-proof requirement is inapplicable.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): The captured proof exercises production SQLite admission and catalog reuse through isolated Linux agent turns, compaction, and shutdown, with observed statement-count reduction. Native scale controls separately exercise the metadata-disposal repair and show recovery from the introduced OOM. Final-head changes only attach the existing rationale to its guarded call. No stored-data contract changes, so the previous migration-proof requirement is inapplicable.
Evidence reviewed 11 items Pinned introduced change: Reviewed the host-pinned merge-base-to-head diff. The supplied test merge is stale and was not used to infer removal of current-main behavior.
One schema lifecycle: The ensurer consumes admitted table/index facts, retains native installation when facts are unavailable, and uses the existing transaction owner. That owner refreshes freshness after BEGIN; schema tracking still invalidates DDL, rollback, replacement, and retired snapshots.
Receipt transfer preserves catalog facts: Transferred facts now validate and retain index names and trigger definitions. Existing physical-identity and live receipt checks remain around adoption; the patch does not change which principals can perform final effects.
Findings None None.
Security None None.

How this fits together

OpenClaw’s SQLite admission layer validates database handles before session and worker operations consume them. Its connection-owned facts let those operations avoid repeated catalog scans while preserving freshness and cleanup.

flowchart TD
  A[Agent and worker operations] --> B[Database admission]
  B --> C[Connection catalog facts]
  C --> D[Canonical validation]
  C --> E[Required objects present]
  E -->|Yes| F[Execute operation]
  E -->|No| G[Existing installation transaction]
  G --> F
  H[Schema changes or handle disposal] --> C
Loading

Before merge

  • Add data-model compatibility proof - Confirm migration or upgrade compatibility proof before merge.
Agent review details

Security

None.

PR surface

Source +53, Tests +168, Docs +14. Total +235 across 18 files.

View PR surface stats
Area Files Added Removed Net
Source 12 155 102 +53
Tests 5 220 52 +168
Docs 1 14 0 +14
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 18 389 154 +235

Review metrics

Metric Value Why it matters
Production versus regression growth production net +53 lines; tests net +168 lines Production growth carries catalog facts through the existing owner and transfer contract; test growth protects invalidation and native lifecycle behavior.
Measured SQL reduction 65.9 fewer warmed statements per turn, approximately 2.1% The recorded comparison demonstrates execution-count savings on its pinned revisions, without claiming latency improvement.

Stored data model

Persistent data-model change detected: database schema: src/infra/sqlite-schema-facts.ts, database schema: src/state/openclaw-agent-context-engine-turn-outbox-schema.ts, database schema: src/state/openclaw-agent-session-transcript-archive-schema.ts, unknown-data-model-change: src/infra/sqlite-schema-ensure.ts, unknown-data-model-change: src/infra/sqlite-schema-facts.ts. Confirm migration or upgrade compatibility proof before merge.

Technical review

Best possible solution:

Keep schema reuse and invalidation with the existing connection owner, preserving native checks and unchanged persisted contracts.

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

Not applicable as a user bug report; source inspection confirms redundant catalog work, and the recorded isolated workload measures its reduction.

Is this the best way to solve the issue?

Yes. Reusing the admitted catalog and removing caller-maintained flags keeps freshness and cleanup under one existing owner without changing storage formats.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

No label changes.

Label justifications:

  • P2: This is a bounded internal SQLite efficiency improvement with preserved user-facing contracts.
  • 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 (live_output): The captured proof exercises production SQLite admission and catalog reuse through isolated Linux agent turns, compaction, and shutdown, with observed statement-count reduction. Native scale controls separately exercise the metadata-disposal repair and show recovery from the introduced OOM. Final-head changes only attach the existing rationale to its guarded call. No stored-data contract changes, so the previous migration-proof requirement is inapplicable.
  • proof: sufficient: Contributor real behavior proof is sufficient. The captured proof exercises production SQLite admission and catalog reuse through isolated Linux agent turns, compaction, and shutdown, with observed statement-count reduction. Native scale controls separately exercise the metadata-disposal repair and show recovery from the introduced OOM. Final-head changes only attach the existing rationale to its guarded call. No stored-data contract changes, so the previous migration-proof requirement is inapplicable.

Evidence

What I checked:

  • Pinned introduced change: Reviewed the host-pinned merge-base-to-head diff. The supplied test merge is stale and was not used to infer removal of current-main behavior. (b12b0a23cc8b)
  • One schema lifecycle: The ensurer consumes admitted table/index facts, retains native installation when facts are unavailable, and uses the existing transaction owner. That owner refreshes freshness after BEGIN; schema tracking still invalidates DDL, rollback, replacement, and retired snapshots. (src/infra/sqlite-schema-ensure.ts:19, b12b0a23cc8b)
  • Receipt transfer preserves catalog facts: Transferred facts now validate and retain index names and trigger definitions. Existing physical-identity and live receipt checks remain around adoption; the patch does not change which principals can perform final effects. (src/state/openclaw-agent-db-validation-cache.ts:154, b12b0a23cc8b)
  • Closed-reader metadata cleanup: The existing native disposal callback deletes cached metadata and unregisters itself. This releases the expanded catalog reference without SQL or changes to write settlement. (src/state/openclaw-agent-db-metadata.ts:62, b12b0a23cc8b)
  • No stored-model migration: The introduced diff leaves canonical agent/shared-state DDL and schema-version contracts unchanged. Lazy owners still extract the same canonical SQL. The added maps and sets are connection facts, not persisted fields, so the prior generic migration checklist does not apply. (src/state/openclaw-agent-session-transcript-archive-schema.ts:8, b12b0a23cc8b)
  • Regression coverage: Native coverage exercises foreign schema adoption, active snapshots, local DDL, rollback, reopened handles, missing archive indexes, dynamic authorizers, and worker receipt transfer. The outbox boundary also asserts warm execution without redundant DDL or catalog reads. Tests were inspected, not executed during this read-only review. (src/infra/sqlite-schema-facts.test.ts:174, b12b0a23cc8b)

Likely related people:

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

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 (3 earlier review cycles)
  • reviewed 2026-10-06T12:02:04.847Z sha 1a2d1b1 :: blocked before merge. :: none
  • reviewed 2026-10-06T15:54:38.412Z sha 6db8c83 :: blocked before merge. :: none
  • reviewed 2026-10-06T16:17:34.034Z sha b12b0a2 :: blocked before merge. :: none

@steipete

steipete commented Oct 6, 2026

Copy link
Copy Markdown
Contributor Author

ClawSweeper's exact-head review completed for 1a2d1b11cbd61532e17444d69ba1bf9dd40b10b9 with no actionable code or security findings. Its data-model compatibility checklist is satisfied by the existing Evidence section: the published 2026.9.8 driver updated to this exact candidate, reached phase finished with /readyz HTTP 200, preserved durable history, and verified service replacement. I inspected that retained result during landing. The canonical agent and shared-state DDL is unchanged by this PR; the added catalog fields are connection facts, not persisted columns or tables. No schema migration or new storage-design decision is required.

Landing is still investigating CI's Doctor scale-test worker OOM; it has not been classified as inherited or waived.

Merge main to integrate the session reader and admission optimizations. Retire cached metadata with its native connection so closed handles cannot retain expanded catalog facts throughout large archive batches. The existing Doctor scale regression passes five Linux Bun replays after failing all five on the original PR head.
@steipete

steipete commented Oct 6, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@steipete

steipete commented Oct 6, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@steipete
steipete merged commit c106793 into main Oct 6, 2026
167 checks passed
@steipete
steipete deleted the dbasync/sqlopt-schema branch October 6, 2026 17:10
@steipete

steipete commented Oct 6, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

steipete added a commit that referenced this pull request Oct 7, 2026
* perf(sqlite): reuse admitted catalog facts across schema owners

Carry index names and trigger definitions in the existing admitted catalog snapshot. Reuse those facts for canonical session validation and first-use schema installation, removing separate committed-schema caches while preserving foreign changes, rollback, reopen, and dynamic authorizer checks.

* perf(sqlite): retain admitted facts across managed transactions

Keep schema facts collected under synchronous read admission after data-only transaction settlement. Unmanaged snapshots and sibling schema publications observed in a transaction still expire, and the next operation still checks foreign commits. Cover warm worker commands after lazy schema installation.

* fix(sqlite): attach schema query rationale to guarded call

* fix(sqlite): break the agent schema admission loop

Reuse settled native preparation and unchanged admitted schema facts. Keep explicit host readmission, startup journal checks, and schema receipt revocation for observed foreign DDL. Skip covered standing-intent DDL instead of repeating post-commit structural scans.

Addresses repeated schema preparation attributed to #165680; builds on the schema-fact owner in #166102. Schemas, stored bytes, and update behavior are unchanged.

* fix(sqlite): avoid shadowing preparation options

* test(sdk): preserve released agent preparation call forms

* test(sessions): preserve canonical leases after reconcile shutdown
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 7, 2026
* perf(sqlite): reuse admitted catalog facts across schema owners

Carry index names and trigger definitions in the existing admitted catalog snapshot. Reuse those facts for canonical session validation and first-use schema installation, removing separate committed-schema caches while preserving foreign changes, rollback, reopen, and dynamic authorizer checks.

* perf(sqlite): retain admitted facts across managed transactions

Keep schema facts collected under synchronous read admission after data-only transaction settlement. Unmanaged snapshots and sibling schema publications observed in a transaction still expire, and the next operation still checks foreign commits. Cover warm worker commands after lazy schema installation.

* fix(sqlite): attach schema query rationale to guarded call
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 7, 2026
…#166253)

* perf(sqlite): reuse admitted catalog facts across schema owners

Carry index names and trigger definitions in the existing admitted catalog snapshot. Reuse those facts for canonical session validation and first-use schema installation, removing separate committed-schema caches while preserving foreign changes, rollback, reopen, and dynamic authorizer checks.

* perf(sqlite): retain admitted facts across managed transactions

Keep schema facts collected under synchronous read admission after data-only transaction settlement. Unmanaged snapshots and sibling schema publications observed in a transaction still expire, and the next operation still checks foreign commits. Cover warm worker commands after lazy schema installation.

* fix(sqlite): attach schema query rationale to guarded call

* fix(sqlite): break the agent schema admission loop

Reuse settled native preparation and unchanged admitted schema facts. Keep explicit host readmission, startup journal checks, and schema receipt revocation for observed foreign DDL. Skip covered standing-intent DDL instead of repeating post-commit structural scans.

Addresses repeated schema preparation attributed to openclaw#165680; builds on the schema-fact owner in openclaw#166102. Schemas, stored bytes, and update behavior are unchanged.

* fix(sqlite): avoid shadowing preparation options

* test(sdk): preserve released agent preparation call forms

* test(sessions): preserve canonical leases after reconcile shutdown
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling docs Improvements or additions to documentation 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: L 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