Repository navigation
Conversation
Contributor
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
steipete
marked this pull request as ready for review
November 1, 2026 11:54
Contributor
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
steipete
deleted the
steipete/perf-micro-roboclaw-db-300mbs-background-reads-20260919
branch
November 1, 2026 13:24
Contributor
Author
|
Merged via squash.
|
roboclaw-bot
added a commit
that referenced
this pull request
Nov 1, 2026
* fix(ci): allow the host sqlite3 CLI in Knip binary checks #190295 added usage-refresh-stats-measure.ts, which inspects benchmark fixtures with the host sqlite3 CLI. Knip reported it as an unlisted binary and deadcode:dependencies failed on main. Co-authored-by: vyctorbrzezowski <[email protected]> * fix(ci): allow the host sqlite3 CLI in Knip binary checks Worked on by: - @vyctorbrzezowski Co-authored-by: vyctorbrzezowski <[email protected]> OpenClaw-Publication: 0c259938-137e-4428-b495-a3b45716bdeb --------- Co-authored-by: vyctorbrzezowski <[email protected]>
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
Nov 2, 2026
…claw#190295) * fix(usage): avoid rescanning unchanged histories during refresh * refactor(usage): share prepared rollup envelopes during refresh * fix(usage): keep single-session freshness reads keyed * test(sessions): keep lifecycle fixtures outside age retention
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
Nov 2, 2026
…90396) * fix(ci): allow the host sqlite3 CLI in Knip binary checks openclaw#190295 added usage-refresh-stats-measure.ts, which inspects benchmark fixtures with the host sqlite3 CLI. Knip reported it as an unlisted binary and deadcode:dependencies failed on main. Co-authored-by: vyctorbrzezowski <[email protected]> * fix(ci): allow the host sqlite3 CLI in Knip binary checks Worked on by: - @vyctorbrzezowski Co-authored-by: vyctorbrzezowski <[email protected]> OpenClaw-Publication: 0c259938-137e-4428-b495-a3b45716bdeb --------- Co-authored-by: vyctorbrzezowski <[email protected]>
tideclaw-bot
pushed a commit
that referenced
this pull request
Nov 22, 2026
Partial, path-only backport of 6463a0a (#190295). Excludes unrelated usage changes. Fresh timestamps prevent real age-retention maintenance from archiving lifecycle test fixtures before expected-entry deletion. All lifecycle assertions remain unchanged. Co-authored-by: RomneyDa <[email protected]> Co-authored-by: vincentkoc <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What Problem This Solves
Fixes unnecessary transcript reads when background usage refresh revisits histories whose durable rollups are already current.
User Impact
Unchanged histories can refresh without reading every transcript event. Changed or missing histories still use canonical statistics and normal rollup rebuilding. No schema, index, configuration, or cache migration is required.
There is a small dirty-history tradeoff: one additional indexed metadata query. On the synthetic fixture it adds 24 KiB of logical reads per selected-session operation; measured CPU/allocation differences are comparable to A/A variation. Lead accepted: the unchanged-refresh reduction from 21.50 GiB to 0.82 MiB of logical reads outweighs the dirty-path increase of 24 KiB reads, approximately 0.27 ms CPU, and 34 KiB sampled allocation per operation. The lead explicitly approved this tradeoff and landing once exact-head CI is green.
Why This Change Was Made
Refresh computed transcript statistics before checking freshness. The existing session index selects the right rows, but the noncovering byte-total aggregate visits payload-bearing rows across the selected history. A full refresh selects every session.
Read existing rollup metadata first, decode each envelope once, and reuse its exact count/sequence/byte statistics only when the transcript owner's mutation timestamp and rewrite generation match. Imports that append events now strictly advance that timestamp even when the source mtime is equal or older; idempotent imports preserve it. Single-session freshness checks use the existing keyed lookup without first counting all session windows.
Production code grows by 47 lines to connect the existing checkpoint and freshness owners and preserve import invalidation. No new cache is introduced; byte budgets remain exact. Dirty histories retain their canonical scan because existing hot-session metadata does not own exact raw-byte totals.
Evidence
c3fca6737b29956a61faeedd234d7296af48baca, then passes for targeted and full refresh. Equal/older-mtime import regressions also fail before the producer fix.pnpm check:changedcompleted. Its PR-ownedprefer-constfinding is corrected, with targeted lint and core typecheck passing. Its remaining unusedassertSafeSqliteRuntimeexport reproduces on the exact clean parent and was introduced by fix(infra): release completed SQLite readers and prevent cursor restarts #190242; fix(ci): keep SQLite runtime assertion private #190303 (1c437d1bbde7) repairs that main regression.5342923d897ad8a8021bdf586753f8cd38cd3094: two redundant<void>arguments introduced by refactor(agents): run background session work as a fork of the stored session #190158; peer fix(update-repair): preserve repair budgets across wall-clock changes #190298 owns that main regression. No inherited failure is reported as green.The committed
scripts/perf/usage-refresh-stats-measure.tscreates 5,000 sessions and 1.4 million interleaved events, half text/half compressed payloads, in a 39.27 GiB DB. No production data is used. The canonical schema is identical at the investigated deployment revision and measured baseline.The dirty comparison has five interleaved pairs. Candidate A/A median CPU drift is +5.08% versus +6.05% A/B; sampled allocation varies in both A/A sets. This does not prove equality, so the nonzero cost remains explicit. Full-refresh warm timing has five interleaved pairs; candidate A/A wall drift is +0.11% and CPU drift +0.02%. Two earlier I/O-bound baseline scans took 193.8–194.2 seconds and are kept separate, not pooled with warm results. Full allocation has baseline n1/candidate n5; an attempted warm allocation expansion exceeded its 45-second ceiling and was stopped without a completed sample. One accidentally overlapped preliminary series was excluded; final accepted series ran serially. The complete refresh-consumed statistics digest matches on every accepted sample.
Acceptance: identical consumed statistics; eliminate unchanged-history event queries; five interleaved timing pairs with A/A controls; lower full-refresh CPU/time beyond A/A spread; disclose dirty-path and allocation tradeoffs. SQLite page caches are fresh/private, mmap is disabled, and SQL replay records
EXPLAIN QUERY PLANplus pager misses. These are logical reads, not measured physical disk bytes. The measured collection owner excludes envelope decoding and full worker/Gateway scheduling. Host is macOS/APFS with uncontrolled OS cache. Immediate Linux test capacity queued and was canceled under the proof policy. Linux/btrfs physical-I/O reduction and sustained production-reader attribution remain unproven.