Skip to content

fix(sessions): avoid false indexing notices during search - #165879

Merged
steipete merged 1 commit into
mainfrom
ci-fix/uir1-palette-search-indexing
Oct 6, 2026
Merged

steipete merged 1 commit into
mainfrom
ci-fix/uir1-palette-search-indexing

Conversation

@steipete

@steipete steipete commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

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 indexing hint.

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

  • Before: real-Gateway file fails at line 477 on the first query, with indexing: true and the visible indexing notice. The scoped RPC regression also fails after removing only its artificial execution hold.
  • After: the unchanged real-Gateway file passes locally (60.38 seconds), with all 15 searches and no false indexing responses. The real production runtime and matching UI were built through the repository harness.
  • All seven scoped RPC tests pass. The worker test passes, including zero host SQL, true dirty-to-clean invalidation, and retained read-only hits when status execution or admission is unavailable.
  • Type-aware lint, boundary lint, core production types, and both changed-test type graphs (agent/session and Gateway-methods) pass locally.
  • Direct-route P2 review: scoped-clean, no actionable findings.

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.

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.
@clawsweeper

clawsweeper Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime size: S labels Oct 6, 2026
@steipete
steipete enabled auto-merge (squash) October 6, 2026 00:32
@clawsweeper

clawsweeper Bot commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed October 5, 2026, 8:34 PM ET / October 6, 2026, 00:34 UTC.

ClawSweeper review

What this changes

Session 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
Reviewed head: 4febff9429a874b7bc560504677f21dd1fc7ad57

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused lifecycle repair with meaningful retained regressions and reported production-path validation; no actionable patch defect was found.
Proof confidence 🌊 off-meta tidepool Not applicable: Repository State identifies a MEMBER-authored repair, so the ordinary external-contributor gate does not apply. The captured body additionally reports before/after proof through the built real Gateway and command palette, exercising the changed search owner across 15 queries. No stored-data contract changes require migration proof.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: Repository State identifies a MEMBER-authored repair, so the ordinary external-contributor gate does not apply. The captured body additionally reports before/after proof through the built real Gateway and command palette, exercising the changed search owner across 15 queries. No stored-data contract changes require migration proof.
Evidence reviewed 8 items Pinned introduced change: The introduced delta retains an existing canonical execution reference around the history-worker operation and releases it in finally. Incognito handling and the revision validation remain intact.
Current main still needs the repair: Fetched main calls the status owner and then validates the reader revision without the outer execution hold. The requested lifecycle repair is therefore absent from the reviewed main revision.
Verified merge result: The test merge has the pinned main revision followed by the exact PR head as its raw recorded parents. Its production delta preserves the same focused repair; endpoint drift is not attributed to this PR.
Findings None None.
Security None None.

How this fits together

The 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]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +23, Tests +7. Total +30 across 3 files.

View PR surface stats
Area Files Added Removed Net
Source 1 30 7 +23
Tests 2 42 35 +7
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 72 42 +30

Review metrics

None.

Technical review

Best 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.

Labels

Label changes:

  • add P2: False indexing notices affect established session-search behavior, with a bounded lifecycle repair and no demonstrated loss of results.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.

Label justifications:

  • P2: False indexing notices affect established session-search behavior, with a bounded lifecycle repair and no demonstrated loss of results.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.

Evidence

What I checked:

  • Pinned introduced change: The introduced delta retains an existing canonical execution reference around the history-worker operation and releases it in finally. Incognito handling and the revision validation remain intact. (src/config/sessions/session-transcript-search.ts:204, 4febff9429a8)
  • Current main still needs the repair: Fetched main calls the status owner and then validates the reader revision without the outer execution hold. The requested lifecycle repair is therefore absent from the reviewed main revision. (src/config/sessions/session-transcript-search.ts:195, eb405f0d5c50)
  • Verified merge result: The test merge has the pinned main revision followed by the exact PR head as its raw recorded parents. Its production delta preserves the same focused repair; endpoint drift is not attributed to this PR. (src/config/sessions/session-transcript-search.ts:204, ec2a6bcbdd6f)
  • Existing lifecycle owner: Borrowing increments the canonical owner's borrower count and clears idle retirement. Releasing a reference waits for its owned work and only initiates idle cleanup once borrowers reach zero; native opening remains lazy. (src/state/openclaw-agent-execution.ts, 4febff9429a8)
  • Regression coverage retains meaningful checks: The five-agent RPC case removes its artificial execution hold while retaining the result, scope, indexing, and truncation assertions. The worker test additionally covers early maintenance-admission failure and retains actual dirty-to-clean revision invalidation and zero host-SQL checks. (src/config/sessions/session-transcript-search.worker.test.ts:87, 4febff9429a8)
  • Reported production-path validation: The captured PR body reports the unchanged real-Gateway command-palette file failing before the repair and passing afterward in 60.38 seconds, with all 15 searches and no false indexing responses. The inspected harness uses a real isolated Gateway, verifies served production UI assets, and checks RPC indexing flags and visible notices. This review did not execute tests; Linux repetitions and broader checks are explicitly reported unrun. (ui/src/e2e/command-palette-search.real-gateway.e2e.test.ts:477, 4febff9429a8)

Likely related people:

  • unknown: The claimed source-line change could not be verified from bounded local history. (role: source history unknown; confidence: low)
  • goutamadwant: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@steipete
steipete merged commit b106019 into main Oct 6, 2026
112 of 113 checks passed
@steipete
steipete deleted the ci-fix/uir1-palette-search-indexing branch October 6, 2026 00:37
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 6, 2026
…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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gateway Gateway runtime size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant