You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Replace the line-scanning grep fallback with a real SQLite FTS5 index
over the tool_call event stream. A hub subscriber writes each tool call
into a virtual table (trigram tokenizer for substring matching of paths
and identifiers); the /api/search handler queries the index and returns
sessions+snippets newest-first.
Backend
- internal/serve/store: add tool_calls_fts virtual table + IndexToolCall
and SearchFTS methods on the sqlite cost store. Schema version bumped
and FTS table wiped on boot so the tailer's JSONL replay rebuilds it
from scratch — no divergence vs the source of truth on disk.
- internal/serve/store/tool_call_subscriber.go: hub subscriber that
indexes every tool_call published after boot.
- internal/serve/api/search.go: rewrite handler around SearchFTS, bump
minimum query length 2 → 3 (matches the trigram tokenizer's minimum
useful length). Drops scanned_files from the response shape.
- internal/serve/server.go: wire the FTS subscriber and inject the new
SearchSource / SessionNameResolver adapters.
Build
- Makefile: add GO_TAGS := sqlite_fts5 and apply to every go invocation
so test + build + install all pull in the FTS5 amalgamation.
UI
- useSearch: MIN_Q 2 → 3, drop scanned_files from the response type.
- SearchPalette: gate on ≥3 chars.
Tests
- internal/serve/store/search_store_test.go: 9 tests covering literal
substring, session filter, truncation, path-like tokens, empty
content, closed-store errors, subscriber indexing, non-tool-call
filtering, FTS wipe on boot.
- ui/e2e/fixtures/mocks.ts: add a shape-aware catch-all for unmocked
/api/** paths. A 401 from any endpoint bubbles up as
UnauthorizedError and clears the bearer token, dropping the test back
to the paste screen — V13 /api/cost was silently doing that. Catch-all
prevents the whole class of newly-added-endpoint regressions.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
0 commit comments