Repository navigation
refactor(sessions): unify checkpoint mutation flow - #122597
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 19, 2026, 2:43 AM ET / 06:43 UTC. ClawSweeper reviewWhat this changesThe PR routes SQLite checkpoint branch and restore mutations through one discriminated transaction flow while preserving their distinct session-entry outputs. Merge readinessKeep open. Current main still has separate checkpoint branch and restore flows; this focused refactor consolidates them without a concrete correctness finding. The protected Priority: P3 Review scores
Verification
Live VerificationCommand: Result: PASS (completed) Assertions:
How this fits togetherSQLite session checkpoints let Gateway compaction branch or restore a conversation. Gateway prepares any legacy transcript source, then the SQLite accessor validates state, forks transcript rows, updates the session entry, and publishes identity changes. flowchart LR
A[Gateway checkpoint request] --> B[Checkpoint store]
B --> C[SQLite session accessor]
C --> D[Branch or restore decision]
D --> E[Queued database transaction]
E --> F[Transcript and entry update]
F --> G[Session identity notification]
Decision needed
Why: The patch changes the owner of persisted session and transcript mutations, and the protected maintainer label requires explicit human ownership approval despite no code finding. Before merge
Agent review detailsSecurityNone. PR surfaceSource -71. Total -71 across 1 file. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Land the single discriminated checkpoint-mutation owner after session-owner approval and exact-head required checks complete. Do we have a high-confidence way to reproduce the issue? Not applicable: this is a behavior-preserving refactor, and the relevant review path is direct comparison of branch and restore contracts plus existing conformance coverage. Is this the best way to solve the issue? Yes. One discriminated operation removes duplicated transaction ownership while retaining the branch-specific and restore-specific entry projections at the sole required decision point. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 1d2e91477246. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (8 earlier review cycles)
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Landing review is complete at
ClawSweeper's session-owner rank-up move is explicitly satisfied/skipped under Draft PR #123545 remains open and should rebase/adapt onto this canonical flow |
|
Merged via squash.
|
What Problem This Solves
The SQLite compaction checkpoint owner maintained separate branch and restore
mutation flows even though both operations require the same key normalization,
scope resolution, writer queue, transaction, identity snapshots, validation,
transcript fork, entry write, and post-commit identity publication. That
duplication made the transaction boundary and result handling easier to drift.
What Changed
Both operations now use one private discriminated mutation flow and one
synchronous transaction helper.
parent, and drops checkpoint history.
Architectural owner:
src/config/sessions/session-accessor.sqlite-checkpoint.ts.Production delta:
+69/-140, net-71. Tests, docs, config, schema, protocol,generated output, and changelog delta:
0.User Impact
No intended user-visible behavior change. Branch and restore retain their
existing checkpoint selection, conflict/model-lock handling, transcript copy,
session-entry projection, and post-commit identity notifications.
Final Landing Proof
Branch identity
f5a25fccd76c26be2c00d4d813d4eea6e26fefcebd208f6a8d0ac23c6a5b4dc340d56dea8a06e16eb62df3a99ab968ad442943273d89d5fc49716afd39aa62355c87b185041ec492962a5ad6c3ad7272eb329eafdbfff410c4bcb7ce7bf6d441225ac39a7d840ff828446ef5db30c6c396254ad50b110f2aThe two server-generated main refreshes changed only merge ancestry. The
checkpoint patch and resulting target blob remained identical.
Exact-head hosted CI
https://github.com/openclaw/openclaw/actions/runs/32225875832/job/95986353545
https://github.com/openclaw/openclaw/actions/runs/32225875832/job/95986931589
CodeQL, Critical Quality, OpenGrep, Workflow Sanity, iOS Periphery, macOS
Periphery, and Shared OpenClawKit Periphery also passed at this exact head.
Blacksmith Testbox
f0e49b9d5bfa8fbadd5bf94f6654256ad78080cd6a478d52cc00549fbb5fca4b0917f514dcba4193tbx_01m0cbyv7xka5hqgn62dxq36mchttps://github.com/openclaw/openclaw/actions/runs/32224367203
https://github.com/openclaw/openclaw/actions/runs/32224367203/job/95980974577
All 80 current focused tests passed (
46 + 9 + 25). Targeted test types,the exact target changed gate (
core,coreTests), target formatting, targetoxlint, and
git diff --checkpassed. The primary workflow completedsuccessfully through SSH cleanup, post steps, runner cleanup, and final job
completion. Build was correctly skipped in this lane.
AWS Crabbox
run_3b406ee3c089cbx_e3dd50291fedLiteral public AWS proof passed
pnpm build, all 80 current focused tests, andbuilt CLI/launcher version and help smokes. The lease was released and owned AWS
inventory was empty.
Review
gpt-5.6-solwith high reasoning, exited 0,found no actionable issue, and scored correctness
0.98.the best fix.
exact head with recommendation
READY FOR /prepare-prand zero findings.again recommended landing the canonical flow after checks and owner
confirmation.
ClawSweeper's session-owner rank-up move is explicitly satisfied/skipped under
the repository's
maint/refactor/testsowner-review exemption and themaintainer's scoped
land if goodauthorization. This is a one-file,behavior-neutral, net-negative maintainer refactor with no schema, config,
protocol, security, or product change.
Collision and moving-main check
decaa60e228bfe17cbe081bb830cd2165c48da45.onto this canonical mutation flow after this lands.
landing stops if main changes the target blob or introduces a real conflict.
AI-assisted: yes.