fix: use HTTP polling in --wait mode for self-hosted compatibility#83
Open
octo-patch wants to merge 1 commit intofirecrawl:mainfrom
Open
Conversation
…ixes firecrawl/firecrawl#3210) When `--wait` is used without `--progress`, the CLI previously delegated to `app.crawl()` (SDK built-in polling), which is incompatible with self-hosted instances and hangs indefinitely. Replace it with the same `startCrawl` + `getCrawlStatus` polling loop already used by `--wait --progress`, but without the stderr progress output. This makes `--wait` work correctly regardless of whether `--progress` is specified. Update tests to cover the new polling path, including timeout behavior.
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.
Fixes firecrawl/firecrawl#3210
Problem
When running
firecrawl crawl <url> --wait(without--progress) against a self-hosted instance, the command hangs indefinitely. This is because the--waitcode path delegates toapp.crawl(), the SDK's built-in polling method, which is incompatible with self-hosted API instances.The
--wait --progresscode path works correctly because it uses a customstartCrawl+getCrawlStatuspolling loop over HTTP.Solution
Replace
app.crawl()in the non-progress--waitpath with the same custom HTTP polling loop already used by--wait --progress, but without the stderr progress output. Both paths now consistently usestartCrawl+getCrawlStatus, making--waitwork correctly on self-hosted instances regardless of whether--progressis specified.Testing
startCrawl/getCrawlStatus)--waitmodenpx vitest run src/__tests__/commands/crawl.test.ts)