Skip to content

fix(collector): heal Polymarket recovered market context - #880

Merged
proerror77 merged 2 commits into
mainfrom
codex/polymarket-v2-recovery
Aug 14, 2026
Merged

fix(collector): heal Polymarket recovered market context#880
proerror77 merged 2 commits into
mainfrom
codex/polymarket-v2-recovery

Conversation

@proerror77

@proerror77 proerror77 commented Aug 14, 2026

Copy link
Copy Markdown
Owner

Change

Recovered markets with a missing or invalid end time now enter the bounded authoritative market-detail queue. Their health remains fail-closed through invalid_end_time_markets, but the collector stays alive so the rotating queue can heal the backlog instead of restarting before it advances.

Issue relationship

None

Validation

  • cargo test -p hft-collector --locked polymarket_raw (92 passed, 2 ignored)
  • cargo test -p hft-collector --locked missing_end_time_recovery_is_bounded_and_rotates_backlog
  • cargo clippy -p hft-collector --locked --all-targets -- -D warnings
  • git diff --check
  • cargo fmt -p hft-collector -- --check remains unavailable because the current pinned formatter reports unrelated existing diffs across the crate; the changed hunk is not reformatted broadly.

Runtime impact and rollback

Production is currently contained with the Polymarket reference collector stopped after its 6-hour restart exposed this recovery crash loop. The release candidate will first be exercised against a CoW copy of the frozen production tape and state. Rollback is the prior immutable binary and untouched production spool; no tape is deleted or rewritten by this PR.

Summary by CodeRabbit

  • Bug Fixes
    • Improved market-detail recovery for markets without an end time.
    • Collection now continues when recovered markets have missing or invalid end times.
    • Added health tracking while recovery proceeds within configured limits.
    • Deferred markets are now revisited reliably during recovery.

@coderabbitai

coderabbitai Bot commented Aug 14, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@proerror77, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 110 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: d960715b-508c-46ee-87c3-9c4cf35cf8bb

📥 Commits

Reviewing files that changed from the base of the PR and between acc8629 and 8dd6719.

📒 Files selected for processing (1)
  • rust_hft/tools/collector/src/polymarket_raw.rs

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 348fcc2b-a29a-4f3c-98d6-f8467449b0c9

📥 Commits

Reviewing files that changed from the base of the PR and between 454f54d and acc8629.

📒 Files selected for processing (1)
  • rust_hft/tools/collector/src/polymarket_raw.rs

📝 Walkthrough

Walkthrough

Market-detail recovery now includes markets without end times, prioritizes them, and continues bounded processing without an invalid-end-time completeness failure. A regression test verifies deferred-market rotation across planning passes.

Changes

Polymarket recovery

Layer / File(s) Summary
Include missing-end-time markets
rust_hft/tools/collector/src/polymarket_raw.rs
Recovery candidates now include markets without end times. Collection schedules detail recovery for these markets and prioritizes them.
Continue bounded recovery and validate rotation
rust_hft/tools/collector/src/polymarket_raw.rs
Collection retains fail-closed health handling while bounded recovery continues. A regression test verifies deferred-market selection on the next planning pass.

Estimated code review effort: 3 (Moderate) | ~15–30 minutes

Merge Risk: ⚪ Minimal · up to acc86

This localized recovery change keeps invalid recovered markets eligible for bounded healing while preserving fail-closed health behavior; no actionable merge-blocking risk remains after normal checks and review.

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the Polymarket collector recovery fix, which is the main change in the pull request.
Description check ✅ Passed The description includes all required sections with specific change, issue, validation, runtime impact, and rollback details.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/polymarket-v2-recovery

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: acc8629dad

ℹ️ 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".

Comment thread rust_hft/tools/collector/src/polymarket_raw.rs Outdated
Comment thread rust_hft/tools/collector/src/polymarket_raw.rs Outdated
@proerror77
proerror77 merged commit 7c72738 into main Aug 14, 2026
50 of 52 checks passed
@proerror77
proerror77 deleted the codex/polymarket-v2-recovery branch August 14, 2026 07:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant