Repository navigation
fix(crawl): surface API errors and failed pages from crawl status - #462
RaphaelFakhri wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
All reported issues were addressed across 3 files
Reply with feedback, questions, or to request a fix.
Fix all with cubic | Re-trigger cubic
|
Thanks for the review. Three of the four findings are fixed in bc5f44c; one is not changed.
|
There was a problem hiding this comment.
All reported issues were addressed across 2 files (changes from recent commits).
Reply with feedback, questions, or to request a fix.
Fix all with cubic | Re-trigger cubic
There was a problem hiding this comment.
0 issues found across 1 file (changes from recent commits).
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
Auto-approved: Crawl status polling now surfaces the API's own error messages and fails loudly when a result page cannot be read, instead of returning partial results as completed; new tests cover unknown jobs and mid-pagination failures.
View guided diff | Re-trigger cubic
5131cf0 to
95ef631
Compare
|
Rebased onto current |
95ef631 to
1e9a61b
Compare
|
Rebased onto v3.30.2. Since agent hints were removed in #530, the three |
Summary
firecrawl_check_crawl_status, and the polling insidefirecrawl_crawl, read job state through the SDK's HTTP layer directly. That path has two defects:Tool 'firecrawl_check_crawl_status' execution failed: Request failed with status code 404instead of the API'sJob not found.nextlinks, a page that answerssuccess: falsestops the loop without an error. The call returns the pages read so far withstatus: "completed"andnext: null, so a partial crawl looks finished.Changes
getCoreJson, which runs a GET through the SDK's HTTP layer and raises a non-2xx answer asCoreHttpErrorcarrying the API'serrormessage, HTTP status and agent hints. Because the status is preserved, the existing 401 credential recovery still applies.success: false, and when a later page hassuccess: false, instead of breaking out of the loop.tests/crawl-status.test.mjswith a fake API covering a two-page crawl, an unknown job, and a page that fails mid-pagination.Test plan
Before the change: 3 tests, 1 pass, 2 fail (
reports the API error for an unknown crawl,fails when a result page cannot be read). After the change: 3 tests, 3 pass.npx eslint src/index.tsandnpx tsc --noEmitreport no problems.The two-page test passes both before and after the change, so it guards against regressions in the join behavior.
Summary by cubic
Makes crawl status checks surface the API's real error messages and fail loudly when a paginated result can't be read.
Previously,
firecrawl_check_crawl_status(and polling insidefirecrawl_crawl) returned raw transport errors likeRequest failed with status code 404for unknown jobs, and silently returned partial results as a completed crawl when a follow-up page failed. Now both cases fail with the API's own error message while preserving the HTTP status so the existing 401 credential recovery still applies.CoreHttpErrorcarrying the API'serrormessage, status, and agent hints for non-2xx responses and for 2xx replies withsuccess: false.success: false.tests/crawl-status.test.mjswith a fake API covering a two-page crawl, an unknown job, a mid-pagination failure, and a first-response failure.Written for commit 1e9a61b. Summary will update on new commits.