Repository navigation
fix(search): relay API error messages for every search, not only Alexandria ones - #546
Merged
Merged
Conversation
firecrawl_search only sent errors through relayExchangeError when the sources included alexandria. Searches with explicit non-Alexandria sources (e.g. ["web"]) went through relayTermsRequired, which rethrows the raw axios error, so a 402 surfaced as "Request failed with status code 402" and dropped the API's message and upgrade link. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
No issues found across 5 files
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
Auto-approved: Fixes firecrawl_search to always use relayExchangeError so API error messages surface for non-Alexandria sources; a focused error-handling fix with a new test covering default, web, news, and alexandria searches.
View guided diff | Turn on auto-fix | Re-trigger cubic
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Closed
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.
firecrawl_searchonly routed errors throughrelayExchangeErrorwhensourcesincludedalexandria. When an agent passed its own non-Alexandria sources (["web"],["news"], ...), the call went throughrelayTermsRequired, which rethrows the raw axios error fromclient.http.post. The agent then sawRequest failed with status code 402with the API's out-of-credits message and upgrade link stripped. Default searches and scrapes were unaffected because they already usedrelayExchangeErroror the SDK's own error normalization.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.errorstring now saysFirecrawl request failed (HTTP N)instead ofAlexandria request failed, since it is no longer Alexandria-only.["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_searcherror handling so non-Alexandria searches (e.g.["web"],["news"]) surface the API's actual error message. Previously these went throughrelayTermsRequired, 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.src/server.tsandsrc/service/search-surface.ts) now always userelayExchangeError, which still handles the terms-required case.errorstring now readsFirecrawl request failed (HTTP N)instead ofAlexandria request failed.["web"],["news"], and["alexandria"]searches.Written for commit a38fcf4. Summary will update on new commits.