Repository navigation
fix(cli): keep status responsive under ingest - #1438
Conversation
Problem: when the daemon API was busy during live ingest, polylogue status could wait on the daemon and then fall back to direct SQLite work that still scanned large read models. That left the operator without a reliable FTS readiness view precisely during catch-up.\n\nWhat changed: bound the explicit daemon status probe, use read-only fallback connections, derive message totals from conversation_stats when present, and skip retrieval-band scans in the direct embedding summary. The fallback still reports archive, FTS, and embedding readiness, but avoids expensive action-event status work.\n\nVerification: pytest tests/unit/cli/test_status.py tests/unit/storage/test_embedding_stats.py tests/unit/storage/test_vec.py -q; ruff format --check + ruff check on touched files; mypy on touched files; real-archive fallback with POLYLOGUE_DAEMON_URL=http://127.0.0.1:1 returned FTS 100.0%.
|
Caution Review failedPull request was closed or merged during review 📝 WalkthroughWalkthroughThe PR optimizes the ChangesStatus Command Optimization
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 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: bfccd96544
ℹ️ 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
Keep
polylogue statususable while the daemon is ingesting by bounding the daemon probe and making the direct SQLite fallback use cheap readiness counters.Problem
The FTS trigger-safety fix keeps FTS current, but operator status could still become unavailable under live ingest pressure. If
/api/statuswas busy, the CLI waited too long and then the direct fallback still touched large read-model paths: full message counts and embedding retrieval-band status could scan expensive tables. That made it hard to confirm that FTS was actually ready during catch-up.Solution
conversation_statsfor message totals when present instead ofCOUNT(*) FROM messages.messages_fts_docsize, not the FTS virtual table.Verification
pytest tests/unit/cli/test_status.py tests/unit/storage/test_embedding_stats.py tests/unit/storage/test_vec.py -q-> 53 passed.ruff format --check polylogue/cli/commands/status.py polylogue/storage/embeddings/status_payload.py tests/unit/cli/test_status.py && ruff check polylogue/cli/commands/status.py polylogue/storage/embeddings/status_payload.py tests/unit/cli/test_status.py-> passed.mypy polylogue/cli/commands/status.py polylogue/storage/embeddings/status_payload.py tests/unit/cli/test_status.py-> success.POLYLOGUE_DAEMON_URL=http://127.0.0.1:1 timeout 12 python -m polylogue.cli --plain statusagainst the real archive returnedFTS indexed: 100.0%.devtools verify --quick-> passed in 43.39s.Ref #1437
Summary by CodeRabbit
Release Notes