Skip to content

feat(search): add opt-in Firecrawl fallback in Go - #118

Merged
debpalash merged 1 commit into
mainfrom
feat/go-firecrawl-provider
Oct 29, 2026
Merged

debpalash merged 1 commit into
mainfrom
feat/go-firecrawl-provider

Conversation

@debpalash

Copy link
Copy Markdown
Owner

What & why

When keyless web search returns no results, an operator can now opt into Firecrawl with FIRECRAWL_API_KEY. This ports the behavior proposed in #116 to the current Go backend: web-only search, plain snippets, and no page scraping. Firecrawl is last in the default keyed fallback order; an unset key leaves it inactive.

Adds bounded authenticated POST requests, strict response/result validation, cancellation/deadlines, redirect blocking, credential redaction, and credential-specific shared clients. Search results stay cached per workspace. Research can use keyed search without the optional browser sidecar.

Type

  • New feature
  • Docs

Validation

  • Signed-off commit (DCO).
  • CLA status to be confirmed before merge.
  • go vet ./....
  • go test -race -p 2 ./internal/leadweb ./internal/config ./internal/api ./cmd/worker ./internal/aicol.
  • Frontend frozen install, lint, tests, and production build.
  • Credentialed provider is opt-in and inactive without a key.
  • No authenticated or login-gated scraping features added.

make test reaches one existing macOS/ARM floating-point assertion failure in internal/provaccuracy/TestNormalizeMatchFreshness (a one-ULP difference). It reproduces on the untouched merged Go baseline; the package tree is identical to origin/main. All other Go unit packages passed. Frontend checks were run separately because that baseline failure stops the make target.

HTTP fixtures cover POST/header/body contracts, limits, malformed and oversized responses, redirects, cancellation, credential formatting, keyless-first order, news behavior, workspace caches, and API-only worker wiring. No paid live requests were made. PostgreSQL/Redis integration checks are left to the PR CI workflow.

Security-sensitive?

Yes: outbound authenticated search and shared-client selection. API keys remain on the Go server, the existing strict egress transport is retained, and API redirects never replay credentials or request bodies. Returned URLs are structurally checked; page reads must enforce their own DNS/redirect policy. Error strings and client formatting redact credentials. See docs/providers/firecrawl.md.

This PR contains the Firecrawl implementation and its required shared transport/wiring only.

Signed-off-by: debpalash <4178343+debpalash@users.noreply.github.com>
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.

1 participant