Repository navigation
fix(memory): recover restored session freshness - #117548
Conversation
|
Codex review: needs maintainer review before merge. Reviewed August 1, 2026, 3:34 PM ET / 19:34 UTC. ClawSweeper reviewWhat this changesThe PR changes memory-core startup catch-up so restored file or SQLite timestamps that move backward are rechecked, while hash-equal session sources receive a one-time metadata refresh instead of a full reindex. Merge readinessThis PR remains necessary: current Priority: P2 Review scores
Verification
How this fits togetherMemory Core scans file-backed and SQLite session transcripts during startup, compares their fingerprints with flowchart TD
A[Restored session transcript] --> B[Startup fingerprint scan]
B --> C{Size or timestamp differs?}
C -->|No| D[Skip clean session]
C -->|Yes| E[Session source sync]
E --> F{Content hash changed?}
F -->|Yes| G[Reindex transcript]
F -->|No| H[Refresh stored fingerprint]
G --> I[Fresh memory search]
H --> I
Before merge
Agent review detailsSecurityNone. PR surfaceSource +25, Tests +249. Total +274 across 4 files. View PR surface stats
Review metricsNone. Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Copy recommended automerge instructionTechnical reviewBest possible solution: Update the branch against current Do we have a high-confidence way to reproduce the issue? Yes—current Is this the best way to solve the issue? Yes—the source-sync owner is the narrowest maintainable repair point because it can use the content hash to distinguish changed content from a harmless restored timestamp and refresh only derived fingerprint metadata. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 7c9794b5c65c. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
72dcae7 to
8616acb
Compare
|
Land-ready proof for exact head
The branch is mergeable. Behind-main drift is unrelated and advisory; no further rebase is needed unless GitHub reports a conflict. |
|
Merged via squash.
|
* commit '81e392b7ff43bcdb7a3be50a99adf65c3b0141b5': fix(channels): preserve filters in offline status diagnostics (#117570) perf(gateway): separate startup maintenance timing (#117577) refactor(tests): deduplicate database-first guard fixtures (#117594) fix(cli): align sessions cleanup label summary by visible width (#117459) perf(gateway): skip empty session reconciliation (#117589) refactor(ui): consolidate cron form control rendering (#117576) fix(memory): recover restored session freshness (#117548) fix(ui): preserve Talk transcript surrogate bounds fix(ui): harden Talk transcript marker bounds test(ui): cover bounded realtime Talk entries fix(ui): bound realtime Talk conversation text
* origin/main: (22 commits) refactor(ui): consolidate cron form control rendering (#117576) fix(memory): recover restored session freshness (#117548) fix(whatsapp): normalize future-proof QA poll and video note ingress (#117579) fix(perf): separate warm and first-device health probes (#117525) fix(ci): repair plugin prerelease validation (#117562) fix(tasks): sanitize every human task and flow detail (#117568) fix(feishu): cancel unread streaming-card error bodies before release (#117312) fix(status): honor explicit local RPC fallback timeouts (#117519) fix(ui): preserve Talk transcript surrogate bounds fix(tasks): validate notification policy before persistence (#117554) refactor: consolidate full release child workflows (#117385) refactor(policy): centralize doctor health-check descriptors (#117578) perf(gateway): mark recovery before model preparation (#117544) fix(ui): harden Talk transcript marker bounds test(openai): parse realtime websocket frames safely fix(openai): keep embedding identity stable across upgrades (#117557) fix(googlechat): drop invalid thread resource names before send (#108324) test(ui): cover bounded realtime Talk entries fix(ui): bound realtime Talk conversation text test(ui): cover reentrant Talk meter cleanup ...
* origin/main: (28 commits) refactor(ui): consolidate cron form control rendering (openclaw#117576) fix(memory): recover restored session freshness (openclaw#117548) fix(whatsapp): normalize future-proof QA poll and video note ingress (openclaw#117579) fix(perf): separate warm and first-device health probes (openclaw#117525) fix(ci): repair plugin prerelease validation (openclaw#117562) fix(tasks): sanitize every human task and flow detail (openclaw#117568) fix(feishu): cancel unread streaming-card error bodies before release (openclaw#117312) fix(status): honor explicit local RPC fallback timeouts (openclaw#117519) fix(ui): preserve Talk transcript surrogate bounds fix(tasks): validate notification policy before persistence (openclaw#117554) refactor: consolidate full release child workflows (openclaw#117385) refactor(policy): centralize doctor health-check descriptors (openclaw#117578) perf(gateway): mark recovery before model preparation (openclaw#117544) fix(ui): harden Talk transcript marker bounds test(openai): parse realtime websocket frames safely fix(openai): keep embedding identity stable across upgrades (openclaw#117557) fix(googlechat): drop invalid thread resource names before send (openclaw#108324) fix(skills): preserve profile in ClawHub command hints (openclaw#117555) fix(cli): explain filtered plugin policy without unsafe recovery (openclaw#117556) fix(irc): strip markdown from outbound text (openclaw#112961) ...
* origin/main: (22 commits) refactor(ui): consolidate cron form control rendering (openclaw#117576) fix(memory): recover restored session freshness (openclaw#117548) fix(whatsapp): normalize future-proof QA poll and video note ingress (openclaw#117579) fix(perf): separate warm and first-device health probes (openclaw#117525) fix(ci): repair plugin prerelease validation (openclaw#117562) fix(tasks): sanitize every human task and flow detail (openclaw#117568) fix(feishu): cancel unread streaming-card error bodies before release (openclaw#117312) fix(status): honor explicit local RPC fallback timeouts (openclaw#117519) fix(ui): preserve Talk transcript surrogate bounds fix(tasks): validate notification policy before persistence (openclaw#117554) refactor: consolidate full release child workflows (openclaw#117385) refactor(policy): centralize doctor health-check descriptors (openclaw#117578) perf(gateway): mark recovery before model preparation (openclaw#117544) fix(ui): harden Talk transcript marker bounds test(openai): parse realtime websocket frames safely fix(openai): keep embedding identity stable across upgrades (openclaw#117557) fix(googlechat): drop invalid thread resource names before send (openclaw#108324) test(ui): cover bounded realtime Talk entries fix(ui): bound realtime Talk conversation text test(ui): cover reentrant Talk meter cleanup ...
* origin/main: (28 commits) refactor(ui): consolidate cron form control rendering (openclaw#117576) fix(memory): recover restored session freshness (openclaw#117548) fix(whatsapp): normalize future-proof QA poll and video note ingress (openclaw#117579) fix(perf): separate warm and first-device health probes (openclaw#117525) fix(ci): repair plugin prerelease validation (openclaw#117562) fix(tasks): sanitize every human task and flow detail (openclaw#117568) fix(feishu): cancel unread streaming-card error bodies before release (openclaw#117312) fix(status): honor explicit local RPC fallback timeouts (openclaw#117519) fix(ui): preserve Talk transcript surrogate bounds fix(tasks): validate notification policy before persistence (openclaw#117554) refactor: consolidate full release child workflows (openclaw#117385) refactor(policy): centralize doctor health-check descriptors (openclaw#117578) perf(gateway): mark recovery before model preparation (openclaw#117544) fix(ui): harden Talk transcript marker bounds test(openai): parse realtime websocket frames safely fix(openai): keep embedding identity stable across upgrades (openclaw#117557) fix(googlechat): drop invalid thread resource names before send (openclaw#108324) fix(skills): preserve profile in ClawHub command hints (openclaw#117555) fix(cli): explain filtered plugin policy without unsafe recovery (openclaw#117556) fix(irc): strip markdown from outbound text (openclaw#112961) ...
* commit '58213dd5389737ff100c6286d110921defeb76e8': fix(channels): preserve filters in offline status diagnostics (openclaw#117570) perf(gateway): separate startup maintenance timing (openclaw#117577) refactor(tests): deduplicate database-first guard fixtures (openclaw#117594) fix(cli): align sessions cleanup label summary by visible width (openclaw#117459) perf(gateway): skip empty session reconciliation (openclaw#117589) refactor(ui): consolidate cron form control rendering (openclaw#117576) fix(memory): recover restored session freshness (openclaw#117548) fix(ui): preserve Talk transcript surrogate bounds fix(ui): harden Talk transcript marker bounds test(ui): cover bounded realtime Talk entries fix(ui): bound realtime Talk conversation text
Closes #117547
What Problem This Solves
Fixes an issue where memory startup catch-up would permanently miss changed session transcripts after a backup restore, filesystem copy, or SQLite rollback moved the transcript timestamp backward without changing its byte size.
Why This Change Was Made
Session file mtimes and SQLite
updatedAtvalues are now equality fingerprints rather than monotonic clocks. Any mismatch marks the transcript as potentially dirty, while the content hash remains the authoritative reindex decision.For hash-equal dirty sessions, the source-sync owner performs one atomic, session-only metadata convergence of
memory_index_sources.mtime/size, guarded by source, path, and hash. It requires exactly one matched row; a concurrent missing or changed row falls through to normal full indexing. Clean hash-equal scans perform no write. Direct and deferred session paths share the same decision.This does not change session storage, transcript rows, chunks, embeddings, schema versions, migrations, config, or provider behavior.
User Impact
Memory search now catches restored or rolled-back transcript changes without requiring a forced reindex. Restoring identical content also converges once instead of re-reading and rehashing that transcript on every future startup.
Evidence
tbx_01kyz7dc13jwnnsjw7f0yjxnz0, run https://github.com/openclaw/openclaw/actions/runs/30711346170.indexFile.manager.fts-only-reindex.test.tsspent about 160 seconds cold-loading plugin capability discovery before a manager-only assertion.resolveMemorySearchConfig; manager construction and both forced reindexes completed in milliseconds afterward.mainindependently landed the equivalent manager-test isolation (plugins.enabled=false) while this diagnosis was running. The rebase dropped the redundant local test commit and kept the canonical current-main version. The proof patch passed all 17/17 cases in 1.73 seconds of test time on run https://github.com/openclaw/openclaw/actions/runs/30714473472; the final PR head now inherits that current-main repair.git diff --checkpassed. The final patch-identical rebased branch passed fresh P1 Codex autoreview and TruffleHog with no accepted/actionable findings at 0.93 confidence.+28/-3(net+25); tests:+261/-12.The earlier changed gate also reached an unrelated current-main max-lines ratchet shrink requirement for
ui/src/pages/agents/memory/dreaming.ts; no touched-file lane failed. The repo-native landing flow will validate the final head against the current base after exact-head hosted CI completes.Release-note context: memory startup now detects restored session transcripts whose timestamps moved backward without repeatedly reprocessing unchanged content.
AI-assisted: yes. The implementation was independently reviewed, refined after owner-boundary review, and remotely validated with real SQLite state.