test: QA integration tests + fix FTS5 query escaping#6
Conversation
Add 19 integration tests verifying Think/Recall/Sessions with real production DB (268K+ chunks): - 5 session tests (no embedding, fast) - 2 file-recall tests (no embedding) - 6 think tests (with embedding) - 3 topic-recall tests (with embedding) - 3 MCP wiring tests Fix FTS5 syntax error: raw query text with special characters (dots, dashes) caused `apsw.SQLError: fts5: syntax error`. Now escapes query terms by wrapping in double quotes and using OR semantics for lenient matching. 67 total tests pass (48 existing + 19 new). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (2)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
| Empty/whitespace-only queries return a wildcard match-all. | ||
| """ | ||
| if not query or not query.strip(): | ||
| return "*" |
There was a problem hiding this comment.
Invalid FTS5 fallback * causes syntax error
Medium Severity
_escape_fts5_query returns a bare "*" for empty/whitespace queries and for inputs consisting entirely of double-quote characters. A standalone * is not valid FTS5 MATCH syntax — it's only valid as a suffix on a term (e.g. prefix*). Using it in WHERE chunks_fts MATCH '*' raises apsw.SQLError: fts5: syntax error, which is the same class of crash this PR aims to fix.
Additional Locations (1)
…#6) Add 19 integration tests verifying Think/Recall/Sessions with real production DB (268K+ chunks): - 5 session tests (no embedding, fast) - 2 file-recall tests (no embedding) - 6 think tests (with embedding) - 3 topic-recall tests (with embedding) - 3 MCP wiring tests Fix FTS5 syntax error: raw query text with special characters (dots, dashes) caused `apsw.SQLError: fts5: syntax error`. Now escapes query terms by wrapping in double quotes and using OR semantics for lenient matching. 67 total tests pass (48 existing + 19 new). Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>


Summary
apsw.SQLErrorTest breakdown
Test plan
🤖 Generated with Claude Code
Note
Medium Risk
Touches query construction for FTS5
MATCH, which can affect search correctness and recall; the new tests also depend on a large “production” DB and embeddings, increasing CI/runtime fragility even though logic changes are small.Overview
Fixes hybrid keyword search crashes by escaping user
query_textbefore passing it to FTS5MATCH(quotes each term, strips embedded quotes, joins withOR, and falls back to*for empty input).Adds a new
test_think_recall_integration.pysuite that runs against the production SQLite DB to validatesessions(),think(), andrecall()behavior end-to-end (including embedding-backed paths) and verifies MCP tool registration/annotations.Written by Cursor Bugbot for commit 5e7aa23. This will update automatically on new commits. Configure here.