Repository navigation
fix(daemon): bound FTS health counts - #1436
Conversation
|
Warning Review limit reached
Your plan currently allows 1 review/hour. Refill in 19 minutes and 14 seconds. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more review capacity refills, 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 trial, open-source, and free plans. In all cases, review capacity refills continuously over time. 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 (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.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a6e8c0ced4
ℹ️ 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".
|
Historical Codex triage: evidence checked at 5ebcfe5. This records that source revision; it does not claim a fresh review of current master.
Only the rows listed above are dispositioned. Held findings remain open. |
Summary
Make the daemon medium-tier FTS health check use the bounded
conversation_statsmessage count when it is available, and report stale over-indexed FTS rows as degraded instead of healthy.Problem
The deployed FTS replacement fix restored production FTS parity, but
polylogue --plain statusstill timed out while live ingest was processing a large Codex session. The/api/statuspayload includes medium health checks, andfts_readinessstill scannedmessagesdirectly. The check also only treated under-indexing as unhealthy, so an overcount drift like the production failure could be reported as OK.Solution
polylogue.daemon.health._check_fts_readiness_mediumnow readsSUM(message_count)fromconversation_statswhen that table exists, falling back toCOUNT(*) FROM messagesonly for minimal or legacy fixtures. Any mismatch between expected message count andmessages_fts_docsizeis degraded: undercounts report unindexed gaps and overcounts report stale extra indexed rows.Verification
pytest tests/unit/daemon/test_health_check_paths.py::test_fts_readiness_ok tests/unit/daemon/test_health_check_paths.py::test_fts_readiness_error_when_large_gap tests/unit/daemon/test_health_check_paths.py::test_fts_readiness_counts_docsize_not_virtual_table tests/unit/daemon/test_health_check_paths.py::test_fts_readiness_uses_stats_not_message_scan tests/unit/daemon/test_health_check_paths.py::test_fts_readiness_flags_stale_extra_rows -q→ 5 passedpython -m ruff format --check polylogue/daemon/health.py tests/unit/daemon/test_health_check_paths.py→ 2 files already formattedpython -m ruff check polylogue/daemon/health.py tests/unit/daemon/test_health_check_paths.py→ All checks passedpython -m mypy polylogue/daemon/health.py tests/unit/daemon/test_health_check_paths.py→ Successdevtools verify --quick→ exit_code 0, total_duration_s 38.63