[codex] Fix critical search indexing and performance#1
Open
Techie5879 wants to merge 6 commits into
Open
Conversation
Techie5879
marked this pull request as ready for review
June 18, 2026 20:48
Techie5879
force-pushed
the
fix/critical-search-and-perf
branch
from
June 18, 2026 20:51
8e4d005 to
5a62b20
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
This PR fixes the smart session picker indexing path so search no longer rebuilds the whole corpus or reopens/migrates the sidecar database on each search path. It adds a shared sidecar connection, WAL/busy timeout settings, incremental session-level indexing, schema-version cache reset, FTS5-safe rebuild/delete handling, and vector-state preservation across opens.
It also tightens the search corpus and picker behavior:
session.listcommand path with higher-priority keymap bindingsThe second commit adds deterministic fuzzy-search performance coverage, an opt-in readonly live benchmark, and upstream API verification notes.
Why
The root issue was that the plugin treated index invalidation as a reason to rebuild too much state too often. Search and preview paths could repeatedly open the sidecar, write metadata, rebuild external-content FTS rows, and fetch full message corpora even when only one session changed. That created latency, write contention, and an FTS corruption risk when external-content rows did not mirror the content table exactly.
Impact
Users should see faster picker startup/search refreshes, safer cache recovery, less log noise, and more predictable hybrid/fzf behavior on large workspaces. The sidecar remains plugin-owned derived data, so schema mismatches or corruption are handled by deleting and rebuilding only the cache.
Validation
bun run testbun run test:perf