Repository navigation
fix(history): scale the integrity check bound with index size - #8709
Conversation
quick_check reads every index page, so its cost grows with the file. The fixed 30 s bound stopped a 4 GiB index from ever verifying: every check timed out, the generation stayed unverified, and /api/request-history answered 500 permanently while the index itself was healthy. Derive the per-generation bound from the index file size at a conservative scan rate, keeping the 30 s floor for small indexes and a 15 minute cap so a wedged worker stays bounded. An explicit checkTimeoutMs option still wins for tests. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
✅ Deterministic PR hygiene checks passed. |
✅ READY
Review readiness checklist
✅ 4/4 boxes ticked. This pull request is already Ready for Review. Hygiene✅ Deterministic PR hygiene checks passed. |
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
|
Maintainer integration into
Thanks @omar391. |
Summary
PRAGMA quick_checkreads every index page, so its cost scales with the index file — but the lifecycle monitor bounded every check at a fixed 30 s.routing-history.sqlitethe worker check cannot finish inside 30 s: every attempt times out, the generation never verifies, andGET /api/request-historyanswers 500 (RequestHistoryIndexBusyError) permanently even though the index itself is healthy (verified locally:quick_checkreturnsokin ~30 s on the affected install).checkTimeoutMsoption still wins for tests.structure/dashboard-and-usage.mdcontract text updated to match.Test plan
bun test tests/usage/request-history-integrity.test.ts— 25/25 pass, including two new regressions (pure bound derivation + a 4 GiB sparse index getting the scaled bound)bun run typecheck— clean (2,533 files)Generated with Devin
Review readiness checklist
This PR stays in draft until every box below is ticked. Tick all four boxes once the requirements are met:
Required local validation passed; commands, results, and any full-suite exception are documented.
I pushed my PR to a recent dev commit (at most 10 behind; a maintainer may still ask for the exact tip before merge).
I resolved all correct Codex and CodeRabbit findings.
My PR is ready for review.
Summary by CodeRabbit