python-sdk: include "cancelled" in CrawlJob.status and exit wait loop on cancel (fixes #2190)#2240
Merged
rafaelsideguide merged 7 commits intofirecrawl:mainfrom Oct 1, 2025
Merged
Conversation
Collaborator
|
@cubic-dev-ai rerun |
Contributor
@rafaelsideguide I've started the AI code review. It'll take a few minutes to complete. |
Contributor
Author
|
@rafaelsideguide maybe you have to add this REDIS_RATE_LIMIT_URL in test-server |
Collaborator
|
@Jeelislive hmm could you pls remove the redis rate limit url from the workflow? I don't want to include that in this PR. Don't worry about the checks failing (they do very often unfortunately haha) |
rafaelsideguide
requested changes
Oct 1, 2025
Collaborator
rafaelsideguide
left a comment
There was a problem hiding this comment.
pls remove the changes from workflows
rafaelsideguide
approved these changes
Oct 1, 2025
Collaborator
|
Thanks, @Jeelislive! Merged. Really appreciate the effort here! |
|
Great effort! Any idea when this will be released and under what version for firecrawl-py? |
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.
Summary:
- Add missing "cancelled" status to v2 CrawlJob and return immediately on cancellation in wait_for_crawl_completion().
Why:
- API can return status="cancelled", but SDK only allowed "scraping/completed/failed", causing Pydantic errors (see it Fixes
#2190 ).
Changes:
- apps/python-sdk/firecrawl/v2/types.py: CrawlJob.status → include "cancelled".
- apps/python-sdk/firecrawl/v2/methods/crawl.py: treat "cancelled" as terminal.
Tests:
Backwards compatibility:
- Additive; no breaking changes.
Summary by cubic
Add “cancelled” support to CrawlJob and exit the wait loop when a crawl is cancelled. This fixes Pydantic validation errors and returns promptly on cancellation.