Repository navigation
improve(sessions): reduce repeated reads during session updates - #149537
Conversation
|
🦞👀 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. |
|
Codex review: needs maintainer review before merge. Reviewed September 16, 2026, 12:24 AM ET / 04:24 UTC (Revision 4). ClawSweeper reviewWhat this changesReuses freshly read session metadata during compaction, Goal edits, and parent forks, with regression coverage for read budgets and preserved state. Merge readiness✅ Ready for maintainer review Keep open: this remains a useful, bounded optimization absent from current main. Source review found no actionable defects, and the recorded owner-flow measurements support the claimed reduction in reads. Priority: P2 Review scores
Verification
How this fits togetherOpenClaw’s session storage receives conversation updates and persists metadata and transcripts in SQLite. These operations feed subsequent session reads, Goal controls, and child conversations. flowchart TD
A[Compaction, Goal edit, or parent fork] --> B[Existing session operation owner]
B --> C[Check authority and read current state]
C --> D[Reuse canonical session snapshot]
D --> E[Existing SQLite entry writer]
E --> F[Commit state and publish results]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +9, Tests +183. Total +192 across 6 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep canonical snapshot reuse inside the existing transaction owners, preserving validation, callback ordering, and the separate provenance inputs. Do we have a high-confidence way to reproduce the issue? Not applicable as a functional bug report; source confirms redundant hydration, and the recorded before/after owner measurements quantify it. This review did not execute tests. Is this the best way to solve the issue? Yes. Passing freshly captured canonical entries through an existing writer option is a narrow solution that avoids introducing another cache or persistence owner. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 115522a65395. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (3 earlier review cycles) |
|
Merged via squash.
|
Reuse the entry already read in the current write transaction when capturing previous session identity. Preserve the other lookup keys, current authority checks, post-write identity reads, and canonical certification. This resolves the interaction between #149537 and #149388 without changing the existing query budget. The unchanged test reproduces on their combined main state; all 38 Goal, identity, and canonical-validation tests pass after repair.
* fix(cron): normalize current-session completion payloads * fix(cron): account for completed interim retry prompts * fix(cron): preserve final context after retry accounting * refactor(cron): centralize stale delivery policy * fix(cron): clear stale billing after context-only retries * fix(sessions): reuse the admitted entry during Goal edits Reuse the entry already read in the current write transaction when capturing previous session identity. Preserve the other lookup keys, current authority checks, post-write identity reads, and canonical certification. This resolves the interaction between #149537 and #149388 without changing the existing query budget. The unchanged test reproduces on their combined main state; all 38 Goal, identity, and canonical-validation tests pass after repair. * refactor(ui): simplify chat pane callbacks Keep the existing progress-dismiss and agent-change callbacks as explicit void expressions, preserving their undefined returns and side effects. This brings the renderer back within its existing max-lines limit after #149384 without changing UI behavior. * fix(ci): accept file paths in extension packing fixtures
…claw#149537) * perf(sessions): reuse validated entry during compaction * perf(sessions): reuse captured entries for goals and parent forks --------- Co-authored-by: Peter Steinberger <[email protected]>
…49697) * fix(cron): normalize current-session completion payloads * fix(cron): account for completed interim retry prompts * fix(cron): preserve final context after retry accounting * refactor(cron): centralize stale delivery policy * fix(cron): clear stale billing after context-only retries * fix(sessions): reuse the admitted entry during Goal edits Reuse the entry already read in the current write transaction when capturing previous session identity. Preserve the other lookup keys, current authority checks, post-write identity reads, and canonical certification. This resolves the interaction between openclaw#149537 and openclaw#149388 without changing the existing query budget. The unchanged test reproduces on their combined main state; all 38 Goal, identity, and canonical-validation tests pass after repair. * refactor(ui): simplify chat pane callbacks Keep the existing progress-dismiss and agent-change callbacks as explicit void expressions, preserving their undefined returns and side effects. This brings the renderer back within its existing max-lines limit after openclaw#149384 without changing UI behavior. * fix(ci): accept file paths in extension packing fixtures
Related: #146197
What Problem This Solves
Compaction, Goal edits, and parent forks repeatedly fetch session metadata within the same write transaction.
User Impact
These operations perform fewer SQLite reads, including fetching less prompt data during Goal edits. There is no user-visible behavior or configuration change. Authority checks, callback ordering, rollback, identity publication, and transaction boundaries remain unchanged. No latency improvement is claimed.
Why This Change Was Made
The existing entry writer accepts a canonical previous entry. Reuse the entry captured after the operation's callbacks and authority checks, preserving the separate previous-entry argument used for merging and provenance.
Evidence
Measured through the real owners on the observed writable handle:
679287bd9bcc6f804087e01e1e35d46543d112d7, including both Windows jobs. Native preparation verified that hosted evidence without rerunning local gates.execand other handles. State comparisons preserve complete within-run rollback/reopen checks; generated identities are not claimed byte-identical across independent runs.Historical CI at the old compaction-only head failed the alias fixture. The refreshed base includes #149520's single late dependency-link call and #149558's idempotent helper repair; the successful new-head CI is recorded above.