feat(web_search): add Serply search provider - #6100
Open
googio wants to merge 2 commits into
Open
Conversation
Add Serply (https://serply.io) as an opt-in `[search]` provider alongside Sofya and the other keyed backends. `provider = "serply"` sends `GET https://api.serply.io/v1/search?q=...&num=...` with the key in an `X-Api-Key` header and maps `results[].title/link/description` onto `WebSearchEntry`; ads, knowledge graph and related questions are ignored. The key comes from `[search] api_key` or the `SERPLY_API_KEY` env var. Preflight fails closed with a clear message when neither is set, and `SERPLY_API_KEY` joins the workspace `.env` credential allowlist. `BackendId::Serply` records receipts, `api.serply.io` is the network-policy and `default_backend_host` host, and `search_probe_target` covers it for `doctor`. Firecrawl stays the default; existing configs are unchanged. Docs: config.example.toml, docs/CONFIGURATION.md and the zh_hans copy. Signed-off-by: googio <59339358+googio@users.noreply.github.com>
Contributor
|
Thanks @googio for taking the time to contribute. This repository is observing a maintainer-managed PR intake gate in dry-run mode, so this pull request is staying open. This note helps maintainers prepare the allowlist before any enforcement is considered. Please read |
…nd chain run_serply_search classified a missing API key as ExecutionFailed, which run_backend_chain treats as recoverable, so a configured Serply route that reached the adapter after a failed provider-native attempt degraded to DuckDuckGo instead of stopping. Classify it as InvalidInput, matching the preflight not_configured path, and pin the classification with a test that fails without the change. Signed-off-by: googio <59339358+googio@users.noreply.github.com>
Hmbown
enabled auto-merge (squash)
September 12, 2026 05:32
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.
Summary
Adds Serply (https://serply.io) as a
[search]provider for the Web tool, following the shape of the Sofya adapter in #2790.provider = "serply"callsGET https://api.serply.io/v1/search?q=...&num=...with the key in anX-Api-Keyheader and mapsresults[].title/link/descriptionontoWebSearchEntry. Ads, knowledge graph and related questions in the response are ignored.[search] api_keyor theSERPLY_API_KEYenv var; preflight fails closed with a clear message when neither is set, andSERPLY_API_KEYjoins the workspace.envcredential allowlist.BackendId::Serplyfor receipts,api.serply.iofor network policy anddefault_backend_host,search_probe_targetfordoctor.config.example.toml,docs/CONFIGURATION.md,docs/zh_hans/CONFIGURATION.md.Opt-in only: Firecrawl stays the default and nothing changes for existing configs. No new dependencies. CHANGELOG files untouched per CONTRIBUTING.
Disclosure: I work with Serply.
Testing
cargo fmt --all -- --checkcargo clippy --workspace --all-targets --all-features --locked(warning-free under the CI allow list)cargo test --workspace --all-features --locked: every other crate green (40 suites, 2339 tests);codewhale-tui12224 unit tests plus the cucumber and integration targets green. Theruntime_api::testsmodule is order-sensitive in my WSL environment (a different handful of its tests fail on every run of the module, on untouchedmainas well); each of those tests passes when run alone on this branch.New tests:
serply_search_url_encodes_query_and_result_count,parse_serply_results_reads_link_and_description_and_skips_malformed_rows,serply_provider_without_api_key_surfaces_clear_error_not_silent_fallback, the Serply rows indoctor_search_probe_targets_cover_every_builtin_providerandevery_configured_provider_maps_to_one_explicit_backend_adapter, and two config parse/round-trip tests.Live check with a real key (
SERPLY_API_KEY,provider = "serply"): a query throughweb_searchreturned ranked Google results with titles, URLs and snippets andsource: "serply"in the receipt; with the key removed the tool fails closed with the Serply message instead of falling back.Checklist