Skip to content

perf(sessions): keep cold snapshots out of metadata reads - #160358

Merged
steipete merged 12 commits into
mainfrom
steipete/perf-micro-session-entry-append-only-redesign-20260919
Sep 29, 2026
Merged

steipete merged 12 commits into
mainfrom
steipete/perf-micro-session-entry-append-only-redesign-20260919

Conversation

@steipete

@steipete steipete commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Metadata reads parsed large checkout baselines and saved prompts even when callers needed only session identity, status, titles, or model facts. A 128-session fixture with 35,054-byte entries allocated 12.45 MB for one metadata list.

User Impact

Metadata reads allocate substantially less memory. Existing stores migrate automatically to schema 24; rollback requires the verified pre-upgrade database backup and matching build.

Why This Change Was Made

Agent schema 24 separates hot facts in session_nodes.entry_json from keyed session_entry_snapshots rows for sessionDiffBaseline, skillsSnapshot, and systemPromptReport. Metadata readers select hot facts; full readers hydrate both in one statement and preserve their public shape and mutable ownership contract. The existing writer updates snapshots atomically with the entry. Snapshot changes advance the node revision, including cross-connection writes; rollback restores data and revision together. Immutable internal metadata borrowing uses the existing owner/revision lifecycle.

This completes one persistence cutover across migration, startup, Doctor rewrite/repair, historical recovery verification, key relocation, import/copy, eviction, and retained-window clearing. It removes the SQL JSON-removal projection and encoding fallback, unused raw-entry accessor, and cache publication's redundant stringify/parse round trip. No config or second cache owner is added. Migration and cross-table revision/recovery handling account for the production-code growth.

Migration and update contract

This is the maintainer-requested hot/cold design and versioned migration under the storage-change checkpoint. Schema layout, version history, and downgrade recovery are documented. Existing monolithic stores migrate through the canonical startup/Doctor schema owner and update-backup flow. Older builds refuse schema 24; rollback requires the verified pre-upgrade database backup and matching build. Transcript bytes, retention, permissions, and shared-state schema are unchanged.

A copied, real-shaped 128-row v23 store preserves all three snapshots and transcript bytes, handles malformed/NUL/overdepth JSON, reopens without rewriting, and rolls back extraction and version publication together. Historical recovery proves artifact adoption; restoring only the old verifier makes the regression fail because the imported artifact remains protected instead of being retired.

Evidence

Allocation measurement

Allocation sampling includes objects collected by minor and major GC. The same opt-in storage benchmark ran before/after on provider blacksmith-testbox, profile openclaw-check, lease tbx_01m3ksx5wavhj7r9mktf35s0qy (run). Baseline db566b093981 versus candidate 003c19f6877b:

Operation Before allocation/call After allocation/call Before time/call After time/call
Exact metadata 61,919 B 15,458 B 0.0843 ms 0.0323 ms
Metadata list, 128 rows 12,445,053 B 438,510 B 15.5849 ms 0.9415 ms
Full-entry control 94,999 B 92,826 B 0.1176 ms 0.1267 ms
Generic label patch 1,258,444 B 1,248,678 B 4.4809 ms 4.1429 ms

Metadata-list allocation falls 96.48% and exact metadata allocation 75.04%. Full reads cost about 9 μs more in this fixture; generic patch allocation is essentially unchanged. Final repair measurements were 443,373 B / 0.7779 ms for the list and 16,069 B / 0.0299 ms for exact metadata. These are isolated owner measurements, not production latency or sustained RSS claims.

Validation

All heavy runs used blacksmith-testbox / openclaw-check. All leases listed below are stopped.

  • tbx_01m3ksx5wavhj7r9mktf35s0qy: node scripts/run-vitest.mjs src/state/openclaw-agent-session-snapshots-migration.test.ts src/commands/doctor-session-sqlite.recovery-generations.test.ts --maxWorkers=1 — 21 passed; migration 1.52 s test time, recovery 34.07 s runner wall. node scripts/run-vitest.mjs test/scripts/upgrade-survivor-assertions.test.ts -t 'reads schema 24 session snapshots' --maxWorkers=1 — 4 passed, 1.09 s wall. Missing tables/snapshots and wrong prompts remain failures. OPENCLAW_SESSION_ENTRY_SNAPSHOTS_BENCH=1 node scripts/run-vitest.mjs src/config/sessions/session-entry-snapshots.benchmark.test.ts --maxWorkers=1 — baseline and candidate passed.
  • tbx_01m3m1gy44kbw82fjdeb0y98fh (run): focused reader/migration/history/provenance/worker-creation groups — 242 passed. Core production types; agents/sessions, state/logging, Gateway, Doctor and root-other test-type graphs; scoped lint; pnpm lint:kysely; and pnpm check:architecture passed. Provenance retained its 17,296-byte write budget and zero-host-SQL assertion. Benchmark refresh passed in 8.64 s wall. The canonical-schema lint repair additionally passed 26 tests / 3.90 s wall.
  • tbx_01m3m5f36dawn11f0g77trmd63 (run): post-integration node scripts/run-vitest.mjs src/state/openclaw-agent-session-snapshots-migration.test.ts src/state/openclaw-state-db-read-admission.test.ts src/config/sessions/session-accessor.readonly.test.ts src/config/sessions/session-accessor.sqlite-provenance.test.ts --maxWorkers=1 — 54 passed, project groups 18.23 s and 13.63 s wall.
  • Formatting, diff checks, and fresh full-candidate Codex autoreview through P2 passed after the final conflict resolution against main 6e58f0986088. The two conflicting fixture files now match that main commit byte-for-byte; storage production code was unchanged by this integration.

Published updater proof and remaining gap

On tbx_01m3kv1satxpywy8cxdbt9ypxe (run), the published [email protected] driver ran the base upgrade-survivor scenario against candidate 778141029e88 with manual restart mode. Candidate build, update success, installed identity, automatic migration, and preserved prompts/config/exec approvals/history assertions all passed before standalone Doctor.

The broader lane failed afterward in existing plugin-native capture lifetime handling: Doctor's private SQLite inspection directory was removed while cached admission state still referenced its native companion. Four traced owners are byte-identical to the original base; execution of that separate defect on the baseline was not reproduced. The upstream lifetime repair (7d8f806a69e6, #160291) is included in the current PR head, but this full upgrade lane has not been repeated. Later startup/status checks did not run. This proves published-driver migration, not a fully green release lane. No operator Gateway was changed.

CI follow-through

CI found and this PR repaired one missed full-entry consumer: bounded recent-session summaries now hydrate snapshots with the same single statement as other full readers. Fixtures use the split representation without weaker assertions. Snapshot upserts bind saved JSON once through excluded; migration DML uses Kysely; the database type import uses its leaf contract to avoid a cycle.

Earlier full changed checks and CI exposed inherited UI type/lint limits, tooling census timeouts, and heartbeat/recovery fixture scheduling failures. No timeout, retry, assertion, or baseline was weakened. The original 29-file recovery and 18-file heartbeat CI groups passed instrumented replays (269 and 303 tests), so those exact CI triggers were not proven by replay. The fixture investigation and candidate proof used tbx_01m3m97ss53a7sfc8ad7rs6fnw (run); the final PR keeps main's canonical fixes instead of duplicate repairs.

The actual conflict-resolution merge includes main's recovery clock fix 9fe93a204e3b, heartbeat/title fixture fix d9569745764f, matched-only consumer parsing abb37032e7f7, redundant-planner-scan removal 714c2c6baa8f, and leaf-config ownership fix b27c79ba1562. The required matrix-limit fix is included. An independently measured equivalent scanner change reduced the census from 60.62 s to 41.58 s; it was discarded after the upstream fix landed. Prior CI at head 68bd5f1a262dea002114e61384edddb125aee098, run 36466313426, completed with 141 successful jobs, 18 skipped jobs, and two failed leaf jobs plus the aggregate gate. checks-node-compact-small-17 failed the hourly/release planner assertion: 82 compact jobs exceed its 79-job limit; this remains held for the CI owner. Main now contains the owning packing repair df582a4010d5 and its hybrid-planner follow-up 2e7f4f8fcd1f; both are included in the integration head 36ad6154612a. checks-node-changed-compact-small-44 hit the 100-second child-process guard in the routed unknown-provider JSON case in src/cli/help-exit.process.test.ts. The inspected CLI/catalog/import owners are unchanged from the merged main parent, but a baseline reproduction has not established an inherited failure. The exact-head replay on blacksmith-testbox / openclaw-check, lease tbx_01m3n98bpve245g1nw1rhfkb73 (run), passed 23 preceding-help/state-validation/JSON cases in 80.49 s runner wall (6 unrelated later cases deselected). The original routed unknown-provider case passed in 11.35 s with its 100-second guard unchanged. Command: CI=1 OPENCLAW_VITEST_MAX_WORKERS=2 node scripts/run-vitest.mjs src/cli/help-exit.process.test.ts -t 'CLI help process exit|rejected CLI process state isolation|models list JSON failure process output'. This did not reproduce or fix the original timeout. The lease was stopped. Incorporating the owning planner repair through expected-head update-branch was refused with a merge conflict; the six conflicts are now resolved and pushed at 36ad6154612a against main 4a448bdd2656. GitHub reports the resulting head mergeable. No workflow rerun, administrative landing, or auto-merge command was issued.

Main integration proof

Head 36ad6154612a integrates main 4a448bdd2656, including the owning planner repairs, while preserving the delivery projection and hot-JSON plus snapshot-revision removal guards. Fresh full-candidate Codex review against that main commit was scoped-clean through P2. On blacksmith-testbox / openclaw-check, lease tbx_01m3nf9at1cpz96g7dsk14tta9 (run), the four focused reader/Doctor/migration files passed 36 tests. Individual runner wall times were 32.90 s (exact reads), 7.92 s (delivery), 11.11 s (Doctor race), and 9.78 s (migration), each using node scripts/run-vitest.mjs <file> --maxWorkers=1. Core production types, agents/sessions/Doctor/state test-type graphs, scoped lint, line caps, complete architecture guards, generated database types, and unused exports passed. Total command: 8m40.31s, exit 0. The lease is stopped. The prior dirty-sync lease tbx_01m3ndt8nn168fekkfd9bv71ws hit sync timeouts before validation and was stopped; the successful run used the reviewed committed head. CI run 36511947648 completed successfully on that exact head with no failed or pending jobs. The lead watcher merged this PR at ae6a88438de3 on September 29 at 02:39:22 UTC.

Follow-ups

Whole-store registry-maintenance clone removal landed separately in #160510. Revision-only lifecycle-effect currency is tracked separately in #160831. The duplicate CLI-access candidate was measured and discarded because allocation and CPU regressed; no implementation remains from it. Generic full-entry patch callbacks continue to hydrate snapshots by their existing contract.

Final fixture repair

CI on 44736ed858da passed the selected storage, type, lint, and other test lanes; only checks-ui-e2e (7/9) failed in run 36454894647. The mocked navigation test observed both panes loading and immediately expected one chat.startup request. Loading is set before full-stream subscription admission, so zero requests is valid at that point. The fixture now awaits the actual request before asserting exactly one. Both deferred responses and the final two-pane rendering assertion remain, preserving duplicate-request detection. No timer, timeout, or assertion was weakened.

On provider blacksmith-testbox, profile openclaw-check, lease tbx_01m3mk5tsybrjj69vyr9t7gnr0 (run), node scripts/run-vitest.mjs ui/src/pages/chat/chat-history-subscription-admission.test.ts ui/src/pages/chat/chat-history-warm-startup.test.ts ui/src/pages/chat/chat-history-observation.test.ts --maxWorkers=1 passed 46 tests / 3 files, 18.37 s runner wall. This includes explicit proof that loading can be true with zero startup requests before subscription ACK. node scripts/check-changed.mjs --base HEAD -- ui/src/e2e/chat-flow.navigation-presentation.e2e.test.ts passed the selected guards, UI E2E types (73.8 s), export scans, formatting, and lint. Total remote command: 6m34s. Fresh Codex review was scoped-clean through P2; the lease is stopped. Browser automation was excluded from this focused proof; the normal PR CI owns the changed E2E case. Its preceding failed CI file took 25.300 s for ten cases (2.664 s for the failed case).

Move saved skill, prompt-report, and diff snapshots into keyed agent-schema-24 rows. Keep full-entry compatibility through same-statement hydration, preserve revision fencing and Doctor/lifecycle ownership, and return immutable borrowed metadata without redundant clones. Metadata fixture list allocation falls about 96%; generic patch cost remains essentially unchanged.
@clawsweeper

clawsweeper Bot commented Sep 28, 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 commands Command implementations size: XL labels Sep 28, 2026
@openclaw-barnacle openclaw-barnacle Bot added the scripts Repository scripts label Sep 28, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 28, 2026
@clawsweeper

clawsweeper Bot commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 28, 2026, 10:36 PM ET / September 29, 2026, 02:36 UTC (Revision 15).

ClawSweeper review

What this changes

Moves saved session snapshots into keyed SQLite rows so metadata reads avoid decoding them, and updates migration, Doctor, recovery, and tests for that storage layout.

Warning

SQLite table change

This PR modifies persisted SQLite tables in src/state/openclaw-agent-db-schema.ts, src/state/openclaw-agent-schema.sql, src/state/openclaw-agent-session-snapshots-migration.ts, src/state/openclaw-agent-session-snapshots-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 - 5 items remain

Keep open: current main lacks the optimization, and the branch has substantial behavior proof with no discrete code defect identified. Adopting its new storage contract still requires a maintainer decision.

Priority: P2
Reviewed head: 36ad6154612a635a2fb6d52ab10a975ec1361411
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) Focused runtime measurement and forward-migration checks support a coherent patch, while storage acceptance and downgrade recovery remain merge gates.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (terminal): The changed session SQLite readers are exercised by a Linux Testbox benchmark through production exact and list entrypoints, with recorded lower after-fix metadata allocation; a published 2026.9.6 updater also migrated candidate state with preserved prompts before Doctor. The broader Doctor/startup lane was not completed, and no matching-build backup restore is recorded, so stored-data compatibility remains insufficient.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (terminal): The changed session SQLite readers are exercised by a Linux Testbox benchmark through production exact and list entrypoints, with recorded lower after-fix metadata allocation; a published 2026.9.6 updater also migrated candidate state with preserved prompts before Doctor. The broader Doctor/startup lane was not completed, and no matching-build backup restore is recorded, so stored-data compatibility remains insufficient.
Evidence reviewed 10 items Current main: Fetched main still declares agent schema 23; its session metadata query retains the inline-JSON projection, so the central optimization is absent.
Introduced storage contract: The pinned PR diff introduces keyed snapshot rows, cascading deletion, and triggers that advance a session node revision when snapshot rows change.
Migration implementation: The existing schema owner extracts snapshots from readable older rows in bounded batches within its migration transaction.
Findings None None.
Security None None.

How this fits together

A per-agent SQLite database stores session facts and saved snapshots. Gateway metadata views need compact session facts, while full readers and Doctor need complete entries for runtime and repair.

flowchart LR
A[Session updates] --> B[Agent SQLite writer]
B --> C[Hot session facts]
B --> D[Cold snapshots]
C --> E[Metadata reads]
C --> F[Full entry reads]
D --> F
E --> G[Gateway views]
F --> H[Runtime and Doctor]
Loading

Decision needed

Question Recommendation
Should OpenClaw adopt schema 24's keyed session snapshots with older-build refusal and backup-only rollback? Accept the storage split: Record independent storage-owner acceptance and verify matching-build restoration before merging the versioned cutover.

Why: A new canonical SQLite representation and downgrade contract require recorded maintainer acceptance; the PR's own description and self-referencing documentation do not establish that choice.

Before merge

  • Resolve merge risk (P1) - Migrated schema 24 databases are refused by older builds. Backup-only rollback is documented, but restoration of a verified pre-upgrade database using its matching older build has not been demonstrated.
  • Resolve merge risk (P1) - The PR makes saved snapshots canonical in a new table without an independent recorded maintainer acceptance of that representation and downgrade contract.
  • Complete next step (P2) - Record independent acceptance of schema 24 and verify restoration of a pre-upgrade backup with its matching older build.
  • Resolve maintainer decision - Resolve the maintainer decision shown above before merge.
  • Add data-model compatibility proof - Confirm migration or upgrade compatibility proof before merge.
Agent review details

Security

None.

PR surface

Source +435, Tests +727, Docs +46, Config 0, Generated +8, Other +19. Total +1235 across 70 files.

View PR surface stats
Area Files Added Removed Net
Source 38 673 238 +435
Tests 26 808 81 +727
Docs 2 46 0 +46
Config 1 1 1 0
Generated 2 9 1 +8
Other 1 19 0 +19
Total 70 1556 321 +1235

Review metrics

Metric Value Why it matters
Agent schema version 23 → 24 The versioned representation change makes upgrade and downgrade behavior a maintainer decision.
Production and test LOC production +435 net, tests +727 net The PR attributes production growth to the migration and complete reader, writer, and Doctor cutover.

Stored data model

Persistent data-model change detected: database schema: scripts/e2e/lib/upgrade-survivor/assertions.mjs, database schema: src/state/openclaw-agent-db-schema.ts, database schema: src/state/openclaw-agent-schema.sql, database schema: src/state/openclaw-agent-session-snapshots-migration.ts, database schema: src/state/openclaw-agent-session-snapshots-schema.ts, migration/backfill/repair: scripts/e2e/lib/upgrade-survivor/assertions.mjs, and 12 more. Confirm migration or upgrade compatibility proof before merge.

Merge-risk options

Maintainer options:

  1. Approve and prove recovery (recommended)
    Record independent acceptance of schema 24 and demonstrate restoration of the verified pre-upgrade database with its matching older build.
  2. Pause the cutover
    Defer merging if the backup-only downgrade contract cannot be accepted or demonstrated.

Technical review

Best possible solution:

Use one versioned session store that serves metadata without cold payloads and restores complete entries for runtime and Doctor, with a demonstrated reversible upgrade path.

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

Not applicable as a bug reproduction. The PR supplies a repeatable 128-session production-reader benchmark for the reported allocation cost.

Is this the best way to solve the issue?

Unclear until the storage contract is accepted. The split coherently avoids cold-payload decoding, but its downgrade path needs a matching-build restore demonstration.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

No label changes.

Label justifications:

  • P2: This is a measurable session-read performance improvement without evidence of an urgent user outage.
  • merge-risk: 🚨 compatibility: Schema 24 migration makes existing databases unreadable by older OpenClaw builds without backup restoration.
  • merge-risk: 🚨 session-state: The PR changes canonical storage and recovery of saved session snapshots.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit 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 changed session SQLite readers are exercised by a Linux Testbox benchmark through production exact and list entrypoints, with recorded lower after-fix metadata allocation; a published 2026.9.6 updater also migrated candidate state with preserved prompts before Doctor. The broader Doctor/startup lane was not completed, and no matching-build backup restore is recorded, so stored-data compatibility remains insufficient.
  • proof: sufficient: Contributor real behavior proof is sufficient. The changed session SQLite readers are exercised by a Linux Testbox benchmark through production exact and list entrypoints, with recorded lower after-fix metadata allocation; a published 2026.9.6 updater also migrated candidate state with preserved prompts before Doctor. The broader Doctor/startup lane was not completed, and no matching-build backup restore is recorded, so stored-data compatibility remains insufficient.

Evidence

What I checked:

  • Current main: Fetched main still declares agent schema 23; its session metadata query retains the inline-JSON projection, so the central optimization is absent. (src/state/openclaw-agent-db-contract.ts:28, 4187710037fc)
  • Introduced storage contract: The pinned PR diff introduces keyed snapshot rows, cascading deletion, and triggers that advance a session node revision when snapshot rows change. (src/state/openclaw-agent-schema.sql:51, 36ad6154612a)
  • Migration implementation: The existing schema owner extracts snapshots from readable older rows in bounded batches within its migration transaction. (src/state/openclaw-agent-session-snapshots-migration.ts:18, 36ad6154612a)
  • Forward migration coverage: The added test copies a schema 23 store and checks hydrated snapshots, unchanged transcript rows, both version markers, reopening, and transaction rollback. It does not restore a pre-upgrade backup with an older build. (src/state/openclaw-agent-session-snapshots-migration.test.ts:93, 36ad6154612a)
  • Production-path measurement: The opt-in benchmark calls the production exact and list readers and checks complete-entry reads. The captured PR body reports a Linux Testbox before/after metadata-list allocation change from 12,445,053 to 438,510 bytes per call; these are fixture measurements, not production RSS. (src/config/sessions/session-entry-snapshots.benchmark.test.ts:70, 36ad6154612a)
  • Published-updater evidence and limit: The captured PR body reports that the published 2026.9.6 updater completed update and migration checks with preserved prompts and state before standalone Doctor. It also records that the wider Doctor and startup lane failed afterward on a separately fixed plugin capture issue and was not repeated.

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • vincentkoc: 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 a matching-build restore of the verified pre-upgrade agent database backup.
  • Link independent maintainer acceptance of schema 24 and its older-build refusal.

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 (14 earlier review cycles; latest 8 shown)
  • reviewed 2026-09-28T14:28:02.452Z sha 83fb033 :: blocked before merge. :: none
  • reviewed 2026-09-28T16:43:45.645Z sha 3ed1ca1 :: blocked before merge. :: none
  • reviewed 2026-09-28T17:11:26.568Z sha 44736ed :: blocked before merge. :: none
  • reviewed 2026-09-28T18:32:09.626Z sha 00026b0 :: blocked before merge. :: none
  • reviewed 2026-09-28T18:45:09.195Z sha 68bd5f1 :: blocked before merge. :: none
  • reviewed 2026-09-28T23:15:23.902Z sha 68bd5f1 :: blocked before merge. :: none
  • reviewed 2026-09-29T01:13:51.378Z sha 68bd5f1 :: blocked before merge. :: none
  • reviewed 2026-09-29T02:25:40.321Z sha 36ad615 :: blocked before merge. :: none

Hydrate cold snapshots when verifying historical migration artifacts, preserving recovery cleanup after schema 24. Include the current main CI matrix fix and record the accepted storage design. Validation continues on Testbox; no live state is changed.
Apply main commit 52ae7e3 unchanged to unblock the inherited ui-other root-budget failure. Session storage and the measured product code are unchanged.
@steipete
steipete marked this pull request as ready for review September 28, 2026 12:43
@steipete
steipete enabled auto-merge (squash) September 28, 2026 12:46
Hydrate bounded full-entry summaries through the canonical snapshot query, use prepared Kysely migration DML, and avoid repeated JSON bindings in snapshot upserts. Keep allocation and consistency limits intact while moving existing fixtures to split storage.

Includes the unchanged Doctor e2e mock repair from main 162dea1. Testbox tbx_01m3m1gy44kbw82fjdeb0y98fh passed architecture, focused lint and types, 242 focused tests, and the allocation benchmark. Fresh review through P2 was clean.
@openclaw-barnacle openclaw-barnacle Bot added the gateway Gateway runtime label Sep 28, 2026
Resolve the actual PR conflict by retaining main 2da0e9a unchanged for deterministic fallback ctime tests. The storage production files are unchanged by this merge. Existing focused proof remains applicable; fresh review of the full candidate against bf3a182 passed through P2.
Hold deferred recovery repair at its scheduler boundary while the real successor claims and releases ownership. The scheduler has its own retained execution proof, so teardown no longer drains unrelated timers during native SQLite work.

Wait for heartbeat delivery or its actual settlement instead of imposing a separate arrival timer. Preserve awareness/reset assertions and join admitted delivery after releasing the hook.

Original constrained shard replays passed and do not establish the exact CI trigger. Candidate proof passed 572 shard tests plus both scheduler-owner cases, focused lint/types and independent review through P2.
@VACInc

VACInc commented Sep 28, 2026 •

Copy link
Copy Markdown
Member

Follow-up on the inherited UI E2E failure: the multiline chat-motion.e2e.test.ts case failed with expected 2 to be greater than 2 in this historical CI job: https://github.com/openclaw/openclaw/actions/runs/36423624274/job/108934497095. Merged PR #160506 fixes that specific test flake on main by checking smooth-scroll intent and final position instead of sampled-frame count. This is separate from this PR's session storage/schema work, does not supersede it, and does not establish that all CI is green.

@openclaw-barnacle openclaw-barnacle Bot added the app: web-ui App: web-ui label Sep 28, 2026
@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Sep 28, 2026
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Sep 28, 2026
Resolve delivery projection and lifecycle snapshot guards together. Retain the canonical schema 24 migration and main CI planner repairs. Fresh Codex review passed through P2; focused Testbox integration proof follows from this committed head after dirty-sync timeouts.
@openclaw-barnacle openclaw-barnacle Bot removed the app: web-ui App: web-ui label Sep 29, 2026
@steipete
steipete merged commit ae6a884 into main Sep 29, 2026
231 of 232 checks passed
@steipete
steipete deleted the steipete/perf-micro-session-entry-append-only-redesign-20260919 branch September 29, 2026 02:39
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 29, 2026
…60358)

* perf(sessions): separate hot facts from cold snapshots

Move saved skill, prompt-report, and diff snapshots into keyed agent-schema-24 rows. Keep full-entry compatibility through same-statement hydration, preserve revision fencing and Doctor/lifecycle ownership, and return immutable borrowed metadata without redundant clones. Metadata fixture list allocation falls about 96%; generic patch cost remains essentially unchanged.

* test(sessions): adapt storage fixtures to split snapshots

* test(sessions): read split snapshots in upgrade assertions

* ci: include main UI type shard rebalance

Apply main commit e7f5a85 unchanged to unblock the inherited ui-other root-budget failure. Session storage and the measured product code are unchanged.

* fix(sessions): complete cold snapshot reader cutover

Hydrate bounded full-entry summaries through the canonical snapshot query, use prepared Kysely migration DML, and avoid repeated JSON bindings in snapshot upserts. Keep allocation and consistency limits intact while moving existing fixtures to split storage.

Includes the unchanged Doctor e2e mock repair from main c4509a8. Testbox tbx_01m3m1gy44kbw82fjdeb0y98fh passed architecture, focused lint and types, 242 focused tests, and the allocation benchmark. Fresh review through P2 was clean.

* test(sessions): synchronize recovery and heartbeat fixtures

Hold deferred recovery repair at its scheduler boundary while the real successor claims and releases ownership. The scheduler has its own retained execution proof, so teardown no longer drains unrelated timers during native SQLite work.

Wait for heartbeat delivery or its actual settlement instead of imposing a separate arrival timer. Preserve awareness/reset assertions and join admitted delivery after releasing the hook.

Original constrained shard replays passed and do not establish the exact CI trigger. Candidate proof passed 572 shard tests plus both scheduler-owner cases, focused lint/types and independent review through P2.

* test(ui): await startup request before coalescing assertion
steipete added a commit that referenced this pull request Sep 29, 2026
Read schema 24 session snapshots from their canonical table before applying the existing upgrade assertions, matching the reader correction in #160358. Preserve prompt bytes and reject missing, malformed, orphaned, or duplicate state.

Validation: 29 selected session-storage cases pass in 10.98 seconds wall time, including the regression that fails with the original reader. Scoped lint and guards pass. The root-test typecheck retains the same 19 diagnostics on the unchanged tooling baseline; independent review found no actionable issues.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

commands Command implementations 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. scripts Repository scripts 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.

2 participants