Repository navigation
fix(crawl): wait out rate-limited status polls and page results only once the crawl ends - #570
Merged
Merged
Conversation
…once the crawl ends
Contributor
There was a problem hiding this comment.
All reported issues were addressed across 2 files
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
…TTP-date Retry-After, assert the wait
Contributor
There was a problem hiding this comment.
0 issues found across 2 files (changes from recent commits).
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
Auto-approved: Makes crawl polling resilient: polls only the first status page while running, collects result pages once at termination, and retries 429 status reads via Retry-After; the added test pins this behavior, so the change is bounded and clearly beneficial.
View guided diff | Turn on auto-fix | Re-trigger cubic
This was referenced Oct 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
firecrawl_crawlstarts a crawl and then pollsGET /v2/crawl/:iduntil it ends. Two things in that loop made the tool fail while the crawl itself was fine:getCrawlStatusWithOriginfollowsnextto collect all documents, and the loop called it on every tick, so a crawl with several result pages issued several status reads every couple of seconds and quickly used up the crawl-status rate limit.Request failed with status code 429, the crawl ID was lost, and the agent typically started the same crawl again.Now the loop reads only the first status page while the crawl runs and collects result pages once, after it reaches
completed,failedorcancelled. A 429 on a status read waits forRetry-After(orretry_after_seconds, default 10s, capped at 60s) and keeps polling; other errors still fail as before.Test:
tests/mcp-crawl-polling.test.mjsserves a running crawl with a second result page, a 429 on the second status read, then completion; it fails onmainwith the 429 and passes here (full suite passes).Summary by cubic
Fixes
firecrawl_crawlpolling so a healthy crawl no longer fails the tool.completed,failedorcancelled, reusing the terminal poll's response as the first result page.Retry-After(seconds or HTTP-date, orretry_after_seconds, default 10s, capped at 60s) and keeps polling; other errors still fail as before.Written for commit 1e39bf9. Summary will update on new commits.