Repository navigation
feat(search): add opt-in Firecrawl fallback in Go - #118
Merged
Merged
Conversation
Signed-off-by: debpalash <4178343+debpalash@users.noreply.github.com>
9 of 10 tasks
This was referenced Oct 29, 2026
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.
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
Validation
go vet ./....go test -race -p 2 ./internal/leadweb ./internal/config ./internal/api ./cmd/worker ./internal/aicol.make testreaches one existing macOS/ARM floating-point assertion failure ininternal/provaccuracy/TestNormalizeMatchFreshness(a one-ULP difference). It reproduces on the untouched merged Go baseline; the package tree is identical toorigin/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.