fix(mcp-server): non-destructive FTS5 check + FTS5 search#241
Conversation
…ATCH
- Replace CREATE/DROP temp table FTS5 check with
sqlite_compileoption_used('ENABLE_FTS5') — no schema mutation,
no crash risk if process dies mid-check
- Switch readied_search_notes from LIKE to FTS5 MATCH with bm25()
ranking and snippet() highlights
- Skip WAL pragma for :memory: databases (silent no-op)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Warning Rate limit exceeded
Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 23 minutes and 39 seconds. ⌛ 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. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (3)
✨ 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.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1b603f4160
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| FROM notes_fts | ||
| JOIN notes n ON n.id = notes_fts.id | ||
| WHERE notes_fts MATCH ? AND n.is_deleted = 0 |
There was a problem hiding this comment.
Guard FTS search when FTS index table is unavailable
This query now hard-depends on notes_fts, but startup only checks that the SQLite binary supports FTS5 and never verifies that migration 008 actually created the table. On older or partially migrated databases, readied_search_notes will now fail with no such table: notes_fts instead of returning results (the previous LIKE query path worked). Consider checking for notes_fts existence (or catching this error) and falling back to a non-FTS query or an explicit migration-required message.
Useful? React with 👍 / 👎.
## Summary - **fix(mcp-server):** non-destructive FTS5 check + switch search to FTS5 MATCH (#241) - **fix:** unwrap getToken IPC result + use exact range for auto-link paste (#240) - **fix:** gate built-in plugins until enabled state loads + fix IPC listener cleanup (#239) - **feat:** allow disabling built-in plugins + fix MCP server FTS5 crash (#237) - **chore(deps):** sync postcss bump from main ## Test plan - [ ] CI passes (typecheck, lint, tests, build) - [ ] After merge, run Release workflow via `workflow_dispatch` 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Summary
Addresses two major CodeRabbit findings on PR #238.
1. Non-destructive FTS5 check (was Major)
assertFts5AvailableusedCREATE VIRTUAL TABLE+DROP TABLEto probe FTS5. If the process crashed between those two statements, a stale_fts5_checktable would persist and block all future startups with a false "FTS5 not available" error.Fix: Use
sqlite_compileoption_used('ENABLE_FTS5')— a read-only query that never touches the schema.2. Search now actually uses FTS5 (was Major)
The docstring and PR description said search used FTS5, but the query was still
LIKE '%term%'. The FTS5 triggers were maintaining thenotes_ftsindex on every write, but no reader ever queried it.Fix:
readied_search_notesnow usesnotes_fts MATCHwithbm25()ranking andsnippet()highlights.Also
:memory:databases (no-op but avoids confusion in tests/health checks)Test plan
pnpm --filter @readied/mcp-server build— cleanpnpm --filter @readied/mcp-server test— 5/5 pass🤖 Generated with Claude Code