Skip to content

[codex] Fix critical search indexing and performance#1

Open
Techie5879 wants to merge 6 commits into
mainfrom
fix/critical-search-and-perf
Open

[codex] Fix critical search indexing and performance#1
Techie5879 wants to merge 6 commits into
mainfrom
fix/critical-search-and-perf

Conversation

@Techie5879

@Techie5879 Techie5879 commented Jun 18, 2026

Copy link
Copy Markdown
Owner

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:

  • indexes user-visible user message content plus session titles, while skipping assistant/tool/subtask/agent internals
  • runs keyword and vector search independently so semantic-only matches can rank
  • caches fzf and embedding health checks with timeouts
  • narrows fzf candidates through indexed keyword hits before invoking fzf
  • keeps empty-query picker behavior instant and recency-ordered
  • preserves the shadowed session.list command path with higher-priority keymap bindings

The 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 test
  • bun run test:perf

@Techie5879
Techie5879 marked this pull request as ready for review June 18, 2026 20:48
@Techie5879
Techie5879 force-pushed the fix/critical-search-and-perf branch from 8e4d005 to 5a62b20 Compare June 18, 2026 20:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant