Skip to content

fix: use HTTP polling in --wait mode for self-hosted compatibility#83

Open
octo-patch wants to merge 1 commit intofirecrawl:mainfrom
octo-patch:fix/issue-3210-crawl-wait-hangs-without-progress
Open

fix: use HTTP polling in --wait mode for self-hosted compatibility#83
octo-patch wants to merge 1 commit intofirecrawl:mainfrom
octo-patch:fix/issue-3210-crawl-wait-hangs-without-progress

Conversation

@octo-patch
Copy link
Copy Markdown

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 --wait code path delegates to app.crawl(), the SDK's built-in polling method, which is incompatible with self-hosted API instances.

The --wait --progress code path works correctly because it uses a custom startCrawl + getCrawlStatus polling loop over HTTP.

Solution

Replace app.crawl() in the non-progress --wait path with the same custom HTTP polling loop already used by --wait --progress, but without the stderr progress output. Both paths now consistently use startCrawl + getCrawlStatus, making --wait work correctly on self-hosted instances regardless of whether --progress is specified.

Testing

  • Updated existing "Wait mode" tests to use the new polling path (fake timers + mocked startCrawl/getCrawlStatus)
  • Added a test verifying timeout behavior in --wait mode
  • All 21 tests pass (npx vitest run src/__tests__/commands/crawl.test.ts)

…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.
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.

firecrawl crawl --wait hangs indefinitely on self-hosted instances without --progress flag

1 participant