Skip to content

perf(sessions): skip duplicate transcript root preparation - #127990

Merged
steipete merged 1 commit into
mainfrom
codex/perf-transcript-append-preparation
Aug 22, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/perf-transcript-append-preparation

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fresh SQLite transcript sessions redundantly prepared the same session root between writing the header event and writing the first message event. This added avoidable statements to every first-message append.

Why This Change Was Made

Header and message event appends already ensure their session root synchronously inside the same SQLite transaction. This removes only the duplicate middle preparation and its now-unused timestamp argument; event order, persistence shape, timestamps, rollback, and publication behavior remain unchanged.

User Impact

No user-visible behavior changes. New transcript sessions perform less synchronous SQLite work on their first message.

Evidence

  • Exact-current temporary probe: fresh first-message append executes 29 statements on base and 24 on this branch. The call-count probe was removed rather than committing an implementation-coupled test.
  • Base and candidate owner/conformance/rollback suites: 5 files, 252 tests passed on each head.
  • node scripts/check-changed.mjs -- src/config/sessions/session-accessor.sqlite-transcript-message-append.ts src/config/sessions/session-accessor.sqlite-transcript-store.ts
  • GIT_BRANCH=main pnpm build
  • Diff-scoped TruffleHog scan clean; Codex Sol/high autoreview reported no P0/P1 findings.

@clawsweeper

clawsweeper Bot commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@openclaw-barnacle openclaw-barnacle Bot added size: XS maintainer Maintainer-authored PR labels Aug 22, 2026

Copy link
Copy Markdown
Contributor Author

Land-ready at exact head a4d2c47b03f86338a1c539959d4470e1de203f2f.

  • Root cause: a fresh transcript header event and the following message event each canonically prepare the SQLite session root, but ensureTranscriptHeader repeated that work between them. The PR removes only that duplicate middle preparation; event order, final message timestamp, persistence shape, rollback, and publication remain unchanged.
  • Exact-current red/green: fresh first-message append executes 29 SQL statements on base versus 24 on the PR head. The temporary call-count probe was removed because it is implementation-coupled.
  • Permanent proof: 5 owner/conformance/rollback/transcript files, 252/252 tests passed on both base and PR head; changed-file gates and GIT_BRANCH=main pnpm build passed.
  • Review: native artifacts validate READY FOR /prepare-pr with no findings; TruffleHog was clean and Codex Sol/high autoreview reported no P0/P1 findings.
  • Exact-head CI: run 32586772951 is green, including check-sqlite-session-lifecycle and openclaw/ci-gate.
  • Prepare: OPENCLAW_TESTBOX=1 scripts/pr prepare-run 127990 passed in hosted_exact_or_recent_parent mode and verified the remote PR tree matches the prepared head.
  • Proof gap: no live/UI run; this is an internal behavior-neutral SQLite statement elimination with no user-visible surface. Existing storage lifecycle and rollback boundaries are covered by the permanent suites.

The latest ClawSweeper comment is still the exact-head review-start placeholder, with no findings or Rank-up moves: to apply. Per publisher policy, that queued review does not block landing.

@steipete
steipete merged commit 6ea8a71 into main Aug 22, 2026
231 checks passed
@steipete
steipete deleted the codex/perf-transcript-append-preparation branch August 22, 2026 17:16

Copy link
Copy Markdown
Contributor Author

Merged via squash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR size: XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants