Repository navigation
fix(sessions): avoid false indexing notices during search - #165879
Conversation
359eb9c (#165377) validates the search reader revision after checking index status. Releasing the status writer can close and checkpoint it before that validation, invalidating the search's own snapshot even when all transcript projections are complete. Real command-palette searches then show "Indexing older messages" for an already indexed corpus. Retain the canonical lazy execution across the hit read, status read, and revision validation. Release it after the history read settles. Preserve authorized read-only hits if maintenance admission fails, and keep the existing stale-snapshot and incognito handling. Remove the scoped-search fixture's artificial execution hold while keeping all assertions. Extend the worker availability check to cover early writer admission failure. The real-Gateway e2e file remains unchanged. Database work stays in its existing workers; no schema or stored-data change. Validation: unchanged real-Gateway file before fails, after passes with all 15 searches complete; seven scoped RPC cases and the worker safety case pass. Type-aware/boundary lint, core types, both changed-test type graphs, and independent P2 review pass. Testbox-congestion exception: the lease timed out after 15 minutes queued, before sync or execution. The authorized ready-PR fallback leaves Linux 3x e2e, owning configurations, whole architecture, and full check-changed unrun. This real-Gateway suite is hourly-only under current CI policy.
|
🦞👀 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 October 5, 2026, 8:34 PM ET / October 6, 2026, 00:34 UTC. ClawSweeper reviewWhat this changesSession transcript search retains the database execution owner until search validation finishes, preventing false indexing notices, and updates regression coverage without weakening assertions. Merge readiness✅ Ready for maintainer review The reported regression remains on current main, and this focused repair has no actionable correctness or security findings. Priority: P2 Review scores
Verification
How this fits togetherThe Gateway searches authorized session transcripts in per-agent SQLite stores and returns matching messages plus index-readiness information. The command palette uses that information to show results and indexing notices. flowchart TD
A[Command palette query] --> B[Gateway session selection]
B --> C[Retain database execution owner]
C --> D[Worker reads transcript matches]
D --> E[Check index status and reader revision]
E --> F[Results and readiness notice]
E --> G[Release execution owner]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +23, Tests +7. Total +30 across 3 files. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Keep search lifetime custody with the existing execution owner while preserving conservative stale-index detection and authorized read-only results. Do we have a high-confidence way to reproduce the issue? Yes: current source exposes the status-release/revision-check lifecycle race, and the body identifies an unchanged real-Gateway regression and a five-agent RPC negative control. This read-only review did not execute either reproduction. Is this the best way to solve the issue? Yes: retaining the existing execution owner addresses the lifecycle cause without weakening revision validation or introducing a competing storage owner. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against eb405f0d5c50. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
…65879) 2eb7cdf (openclaw#165377) validates the search reader revision after checking index status. Releasing the status writer can close and checkpoint it before that validation, invalidating the search's own snapshot even when all transcript projections are complete. Real command-palette searches then show "Indexing older messages" for an already indexed corpus. Retain the canonical lazy execution across the hit read, status read, and revision validation. Release it after the history read settles. Preserve authorized read-only hits if maintenance admission fails, and keep the existing stale-snapshot and incognito handling. Remove the scoped-search fixture's artificial execution hold while keeping all assertions. Extend the worker availability check to cover early writer admission failure. The real-Gateway e2e file remains unchanged. Database work stays in its existing workers; no schema or stored-data change. Validation: unchanged real-Gateway file before fails, after passes with all 15 searches complete; seven scoped RPC cases and the worker safety case pass. Type-aware/boundary lint, core types, both changed-test type graphs, and independent P2 review pass. Testbox-congestion exception: the lease timed out after 15 minutes queued, before sync or execution. The authorized ready-PR fallback leaves Linux 3x e2e, owning configurations, whole architecture, and full check-changed unrun. This real-Gateway suite is hourly-only under current CI policy.
What Problem This Solves
Command-palette search reports “Indexing older messages — search again shortly” for a fully indexed corpus. This failed the unchanged real-Gateway test in hourlies 37382954831 and 37388801510 (job 112028948212 in the latter).
359eb9c (#165377) added reader-revision validation after the index-status read. That status read releases its writer; idle cleanup can close and checkpoint it before the revision check. Concurrent searches across agent stores therefore invalidate their own snapshots and return a false
indexinghint.Search now holds a canonical execution reference through the hit read, status read, and revision validation, then releases it after the history-reader operation settles. Native opening stays lazy and SQL stays in the existing workers. Maintenance admission failures still preserve authorized read-only hits, and actual concurrent index changes still produce the conservative hint. Schemas, stored bytes, retention, and permissions are unchanged.
The existing five-agent RPC test no longer keeps writers alive on behalf of production. Every assertion is retained. The worker availability check also covers early maintenance-admission failure. The e2e file is unchanged.
Validation
indexing: trueand the visible indexing notice. The scoped RPC regression also fails after removing only its artificial execution hold.Testbox-congestion exception: the lease timed out after 15 minutes queued, before source sync or command execution, and has been stopped. This ready PR uses the authorized fallback. The three Linux real-Gateway repetitions, complete runtime-config/Gateway-methods/commands configurations, whole architecture check, and full check-changed remain unrun. The real-Gateway suite is hourly-only under the current CI policy; PR CI will not supply those repetitions.