Repository navigation
perf(sessions): retain materialized rows for fact-only refreshes - #169724
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 changes before merge. What this changesThis PR refreshes activity-summary facts and transcript previews without rebuilding unchanged resident session rows. Example: A streaming session receives assistant messages through “Update 11” without changing its stored entry.
Review scores
ProductKind: Performance · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Needs changes before merge - 1 item remains Keep this PR open: it provides a focused performance improvement that current main lacks, with no actionable source defect found. The previous merge conflict is resolved. Priority: P2 Before merge
FindingsNone. Agent review detailsHow this fits togetherThe Gateway session-row projection consumes committed database facts and runtime notifications, then supplies session lists, descriptions, and event snapshots. flowchart TD
A[Committed session facts] --> C[Resident row projection]
B[Runtime notifications] --> C
C --> D[Activity summary facts]
C --> E[Transcript preview backfill]
D --> F[Session lists and snapshots]
E --> F
Technical reviewBest possible solution: Retain the existing projection and certification owners while refreshing only the changed summary and preview facets. Do we have a high-confidence way to reproduce the issue? Current main visibly dirties unchanged rows for these notifications; source inspection establishes the redundant materialization path, supported by reported baseline-negative regressions and Gateway measurements. Is this the best way to solve the issue? The approach is appropriately narrow: it reuses existing facts and backfill owners, preserves conservative preparation, and removes the superseded helper. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against f4793400df6d. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
PR surfaceSource +12, Tests +10. Total +22 across 5 files. Added test files: 0. View PR surface stats
Review metrics
LabelsLabel changes: No label changes. Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (1 earlier review cycle)
Reviewed October 12, 2026, 4:03 AM ET / 08:03 UTC (Revision 2). |
d29f2a7 to
dea4f3f
Compare
|
The remaining CI failure is independently reproduced on main. The scheduled main run at Baseline: https://github.com/openclaw/openclaw/actions/runs/38220958692/job/114717130399 The test, helper, cancellation dispatch/outcome and termination code are unchanged across the tested merge baseline ( All selected projection test shards passed, including both changed files and sibling retention, prepared-read, membership, runtime-ownership, recovery, invalidation, topology and record tests. No new module, export or test file was added. Fail-fast cancelled This resolves the hosted review's remaining baseline-classification request. Landing via the authorized inherited-failure exception with the exact head pinned; no CI reruns or dispatches. |
First-parent upstream fa23864..e099f44 (100 commits, including openclaw#169594 lifecycle/mention bookkeeping in workers, openclaw#169573 input completion, openclaw#169724 fact-only refresh rows, openclaw#169598 target discovery). Conflicts: - session-entry-patch-source.ts: upstream routes host-only commit guards through the worker (`!commitGuard?.nativeSource`); kept our condition that a patch with afterPersistInTransaction (a main-thread closure) stays on the native writer. - compact.types.ts: our "volitional" trigger plus upstream's modelCallUrgency. - session-accessor.ts: upstream dropped the sync updateSessionProfileInvolvement export (no fork caller); recipient authority exports kept. - worker inventory regenerated. Auto-merged files carrying continuation overlay (21) keep it byte-for-byte. Refs #1475 Co-Authored-By: Claude Opus 5.5 <[email protected]>
What Problem This Solves
Runtime activity-summary changes and certified transcript updates rebuilt an unchanged session display row, adding main-thread work during agent turns.
User Impact
No intended behavior change. Summary state and transcript previews continue to update; session lists reuse the current materialization for these fact-only refreshes.
Why This Change Was Made
Keep activity-summary refresh in its existing facts owner. The projection refreshes that facet and schedules existing transcript backfill without replacing the entry-derived row. Dirty, cold, unready, and uncertified rows retain full preparation. Remove the superseded dirty-marking helper. No new cache, schema, configuration, or retained history.
Production delta is +12 lines (36 added / 24 removed): the growth preserves the current summary-watermark and preview-backfill contracts while separating them from full row materialization. The retained closure captures facts and scalar target fields, never a resident row or previous materialization.
Evidence
Synthetic Linux rig measurement, Node 24.19.0, measurement baseline
e15926132cd9, one Gateway/agent database, 20 sessions, one warmup turn each, then 100 verified tool turns with history reads, subscriptions, and list probes. Counter runs and CPU-profile runs are separate; SELF excludes descendants.This is a 17.0% materialization reduction and 15.1% sampled SELF reduction. Remaining full publications still materialize; this does not claim elimination of every equal-entry input or an end-to-end latency improvement on a shared rig.
CI at the exact head completed the selected projection tests and sibling coverage successfully, including accepted-facts, backfill, retention, prepared reads, runtime ownership, invalidation, recovery, and topology. The corresponding changed-test shard wall times were 272 s (accepted-facts group), 266 s (backfill group), and 231 s (retention group); these are whole-shard times. The built-artifact lifecycle failure is inherited: main at
5a1f8c692e9474323c8cbbf6c4d985ed2a1b6f0bindependently failed the same test with the sameagent.waitresult (status: error,AbortError: agent run aborted, no stopReason) during concurrent session deletion. Main job; PR job. The lifecycle test, helper, cancellation dispatch/outcome, and termination code are unchanged between the PR test baseline, tested merge, and independently failing main. Fail-fast cancelledcheck-prod-typesandcheck-test-types-core-5; those checks remain incomplete. Landing under the authorized inherited-failure exception; no CI rerun or dispatch was requested.