Repository navigation
fix: keep session history private and recall current - #149529
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. |
a7c7c34 to
a1ed7e1
Compare
|
Codex review: blocked before merge. Reviewed September 15, 2026, 11:00 PM ET / September 16, 2026, 03:00 UTC (Revision 6). ClawSweeper reviewWhat this changesThe PR tightens session-history access, repairs memory recall freshness and configured-store usage totals, supports multiline archived records, and coalesces streamed-history refreshes. Merge readiness⛔ Blocked before merge - 2 items remain This remains useful, protected implementation work. The earlier archive-ownership finding is addressed, and the requested current-head upgrade and ranking results are now supplied. No blocking code defect was found. Priority: P2 Review scores
Verification
How this fits togetherOpenClaw stores conversation transcripts in SQLite and retained archives. Gateway history readers, memory indexing, and usage accounting consume those records to produce conversation views, recall results, and spending totals. flowchart TD
A[Conversation updates] --> B[SQLite transcripts and archives]
B --> C[Current access checks]
C --> D[Gateway history responses]
B --> E[Memory freshness and indexing]
E --> F[Recall results]
B --> G[Store and agent scoped accounting]
G --> H[Usage totals]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +13, Tests +694, Docs +10, Other 0. Total +717 across 30 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Retain the maintainer-confirmed history boundary and existing storage owners, with revision-based recall freshness that preserves activity ranking and upgrades derived hashes without replacing unchanged chunks. Do we have a high-confidence way to reproduce the issue? Yes, source establishes the equal-size transcript rewrite and configured-store accounting paths, with concrete baseline/candidate observations supplied in the discussion. This read-only review did not execute them locally. Is this the best way to solve the issue? Yes. The patch extends the existing transcript, sharing, and accounting owners, preserves content/provenance clocks, and refreshes derived metadata through conditional writes without introducing another storage or authorization owner. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against b09af220ef31. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (5 earlier review cycles)
|
ebcc811 to
6af7924
Compare
Preserve retained-history sharing, configured-store usage and logical ownership, multiline archived records, and memory freshness across rewrites and cold rebuilds. Coalesce history stream invalidations and batch multi-session statistics while removing redundant production code.
Resolve registered archive owners through the existing bounded SQLite family, deduplicating physical files while preserving lexical store ownership semantics. Cover fixed JSON selectors and shared symlink locators; retain existing unregistered legacy-file compatibility.
Track transcript mutation separately from session activity. Verify legacy source hashes before refreshing metadata, preserve unchanged chunks, and retain content and provenance clocks for recall and ingestion.
6af7924 to
8ad19dd
Compare
|
Current-head validation is complete for The real CLI upgrade checks detected the legacy bare hash, verified content before updating its revision, preserved every unchanged chunk row, and started clean afterward. A same-size offline rewrite produced one new recall hit and zero stale hits. Both ranking checks retained the expected old/fresh score ratio of The retained-history boundary is the intended privacy repair: without a live logical session, direct retained reads require |
|
Merged via squash.
|
* fix: keep session history private and recall current Preserve retained-history sharing, configured-store usage and logical ownership, multiline archived records, and memory freshness across rewrites and cold rebuilds. Coalesce history stream invalidations and batch multi-session statistics while removing redundant production code. * fix: attribute archives across sibling session stores Resolve registered archive owners through the existing bounded SQLite family, deduplicating physical files while preserving lexical store ownership semantics. Cover fixed JSON selectors and shared symlink locators; retain existing unregistered legacy-file compatibility. * fix: preserve memory recall recency after transcript edits Track transcript mutation separately from session activity. Verify legacy source hashes before refreshing metadata, preserve unchanged chunks, and retain content and provenance clocks for recall and ingestion.
Closes #118437
What Problem This Solves
Fixes stale session recall and usage totals, cross-agent usage counting in shared stores, retained private-history access after deletion, and repeated history reloads during message bursts.
User Impact
Session history keeps its sharing rules, same-size transcript edits appear in recall after restart, and configured-store usage totals stay current and scoped to the requested agent. Exact imported multiline transcripts remain readable after archival. No configuration change or schema migration is required.
Memory indexing uses transcript revisions for freshness while preserving source activity for temporal ranking and message provenance. Existing source hashes refresh after content verification; unchanged chunks are retained. Forced rebuilds restore cold transcripts through the existing storage owner. A failed restore preserves the published index and retry state.
Direct reads of a deleted session's retained transcript require
operator.adminwhen no live logical entry remains. Task history keeps its separate authorization and binding checks. This closes the reproduced private-history leak without granting access from a retained identifier alone.Why This Change Was Made
History publication rechecks current sharing authority. Usage refresh carries its original store and logical agent throughout the operation. Archive attribution uses the existing SQLite sibling family and preserves lexical store locators when deduplicating physical aliases. The archive reader retains its compact-JSON fast path while accepting exact multiline imports.
SSE invalidations share pending refreshes while preserving inline event order and a trailing read for changes during an active read. Multi-session statistics use the existing batch API; single-session lookups keep the cheaper point query. Redundant scans, copies, and worker error plumbing are removed. With the temporal-ranking repair included, production code is 13 lines larger overall (464 added, 451 removed).
Unregistered legacy artifacts retain the existing file-reader accounting behavior. Their headers and filenames do not establish a reliable agent owner; this change filters authoritative archive registrations without guessing ownership or discarding historical usage.
Evidence
Current head
8ad19dd69ff6e051c1ae6fa8ca1f00f08da5860dand baseline6cf521932af06af674a90e2319ccbd6212261e5dwere freshly built and compared in one Linux Blacksmith Testbox invocation. All 37 candidate checks passed; baseline passed 20/37. The command completed successfully and the lease was stopped. The candidate production build passed in 5m 6.8s.Actual built Gateway/CLI checks cover cursor paging, anchors, retained privacy, SSE, configured/shared usage, real archival across fixed JSON/shared SQLite/symlink stores, cold recall, equal-size edits, and legacy source-hash convergence. The eight clock/upgrade checks verify preserved activity and provenance, correct keyword ranking, fresh recall after offline edits, unchanged chunk rows for metadata-only upgrades, and a clean subsequent startup.
The strongest gains are inventory work and update bursts. The ordinary HTTP median increased in this run while its p95 decreased; these samples do not establish a general single-page latency improvement. The ordinary HTTP query path is unchanged apart from parsing its URL once.
CI caught the temporal-ranking regression before landing; its five failures were repaired without changing their expectations. One earlier cold Gateway fixture import exceeded its existing setup deadline and passed on an exact rerun with the unchanged deadline. Live proof uses synthetic sessions and proxy identities without inference or an external identity-provider exchange. Legacy-hash proof seeds the verified old index format rather than running an old published binary; lexical/hybrid modes are covered by focused tests.