fix(search): relay API error messages for every search, not only Alexandria ones
firecrawl_search only routed errors through relayExchangeError when sources included alexandria. When an agent passed its own non-Alexandria sources (["web"], ["news"], ...), the call went through relayTermsRequired, which rethrows the raw axios error from client.http.post. The agent then saw Request failed with status code 402 with the API's out-of-credits message and upgrade link stripped. Default searches and scrapes were unaffected because they already used relayExchangeError or the SDK's own error normalization.
- Both search entry points (
src/server.tsand the hostedsrc/service/search-surface.ts) now always userelayExchangeError, which still handles the terms-required case and still leaves 401s to credential recovery. - The fallback message for an error body without an
errorstring now saysFirecrawl request failed (HTTP N)instead ofAlexandria request failed, since it is no longer Alexandria-only. - New test: a 402 with the API's credits message is relayed verbatim for default,
["web"],["news"]and["alexandria"]searches. It failed before the fix with the bare axios message.
No version bump or changelog entry; leaving that to the release.
Summary by cubic
Fixes firecrawl_search error handling so non-Alexandria searches (e.g. ["web"], ["news"]) surface the API's actual error message. Previously these went through relayTermsRequired, which rethrew the raw axios error — a 402 showed only "Request failed with status code 402" and dropped the out-of-credits message and upgrade link. Version 3.30.2 is bumped with a changelog entry for the fix.
- Both search entry points (
src/server.tsandsrc/service/search-surface.ts) now always userelayExchangeError, which still handles the terms-required case. - The fallback message for an error body without an
errorstring now readsFirecrawl request failed (HTTP N)instead ofAlexandria request failed. - New test verifies a 402 with the API's credits message is relayed verbatim for default,
["web"],["news"], and["alexandria"]searches.