Repository navigation
feat(web): firecrawl provider with crawl4ai fallback - #168
Open
ChronodeAi wants to merge 2 commits into
Open
ChronodeAi wants to merge 2 commits into
ChronodeAi wants to merge 2 commits into
Conversation
Opt-in [web] provider = "firecrawl" (FIRECRAWL_API_KEY; keyless tier without it). Fetch, batch fetch via one Firecrawl batch job, and search. crawl4ai serves the visible-browser lane, allow_private_hosts hosts, Firecrawl API errors, and pages Firecrawl was blocked on. PDFs use the shared PDF lane first. skipTlsVerification follows browser_verify_tls. fetch_provider now records the provider that served the page.
Step 1 is now a menu: crawl4ai, firecrawl, builtin (plus the vault's current provider if it is none of those). Choosing firecrawl reports whether FIRECRAWL_API_KEY is set and keeps the browser-profile step, stealth and Chromium install for the crawl4ai fallback. Re-running setup defaults to the vault's current provider.
jordan-gibbs
requested changes
Oct 27, 2026
jordan-gibbs
left a comment
Owner
There was a problem hiding this comment.
Thanks for this. The provider code looks good with no new dependency, sensible batch scrape use, and rawHtml for DOI extraction. Could you split it so it's easier to take?
- Keep the provider on its own without the setup-wizard rewrite in
cli/setup.py, since that lists Firecrawl as option 2 for every user and steers people toward one vendor. - Put the
served_byprovenance in its own small PR since that's useful on its own. - Make the keyless tier an explicit opt-in. Sending URLs to Firecrawl shouldn't happen just because the provider is selected without a key.
This branch has not been deployed
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.
Adds an opt-in
firecrawlweb provider ([web] provider = "firecrawl"). It uses the httpx dependency the core already has, so there is no new dependency. Defaults and every existing provider are unchanged.What it does
fetchcalls Firecrawl v2/scrapeand returns markdown, rawHtml (for DOI extraction), images (asmedia) and the screenshot, which it downloads throughsafe_get.fetch_manysubmits one/batch/scrapejob, polls it until it finishes, and followsnextpages.searchcalls/searchwithscrapeOptionsset, so each result carries its page's markdown.FIRECRAWL_API_KEY, fetch and search use Firecrawl's keyless tier, and batches go one URL at a time.Fallback to crawl4ai. The crawl4ai fallback is built with the vault's profile, magic and settings. Firecrawl cannot use a local login profile, so the following go to crawl4ai:
allow_private_hostshosts, which are never sent to FirecrawlA 404/410 is raised and not retried. If the fallback also fails on a page Firecrawl blocked on, the Firecrawl result is returned, so the existing junk gate and escalation queue still run.
Invariants kept
raw_fileis still saved.skipTlsVerificationis set tonot browser_verify_tls, because Firecrawl defaults to skipping verification (crawl4ai browser lanes fetch with TLS verification off #137).Provenance.
fetch_providernow comes fromserved_by(prov, result). That is the name of the provider that actually served the page (crawl4aifor a handed-off URL). For every other provider it equalsprov.name, as before.Tests. 18 offline tests in
tests/test_web/test_firecrawl_provider.pyusehttpx.MockTransport, a fake fallback provider and stubbed DNS. The full suite passes (1737). A live smoke test against the keyless tier coveredfetch(Wikipedia: 92k chars plus screenshot),search, andfetch-batch. In the batch, a 403 URL was handed to crawl4ai, matching crawl4ai's own batch behaviour.Setup wizard.
hyperresearch setupstep 1 is now a menu listing crawl4ai, firecrawl and builtin. A vault on any other provider also gets that provider as an option, so re-running setup doesn't replace exa or tavily without asking. Choosing firecrawl reports whetherFIRECRAWL_API_KEYis set. It also keeps the browser-profile step, stealth and the Chromium install, because the crawl4ai fallback uses them. Re-running setup defaults to the vault's current provider. Covered by 4 wizard tests with scripted prompts.