#12304: feat: add DeSearch as web_search provider
agents
size: M
Cluster:
Web Search Provider Enhancements
## Summary
Adds [DeSearch](https://desearch.ai/) as a third `web_search` provider alongside Brave and Perplexity.
DeSearch is a decentralized AI search engine built on the Bittensor network (Subnet 22). It provides real-time web search results through a simple REST API.
**What this PR does:**
- Adds `"desearch"` to the provider union in config schema, types, and Zod validation
- Implements `runDesearchSearch()` using the `GET /web` endpoint (`api.desearch.ai/web?query=...&num=...&start=0`)
- Maps DeSearch results (title, snippet, link, date, source) to OpenClaw's standard result format — identical shape to Brave results
- Auth uses raw API key in `Authorization` header (no Bearer prefix), matching the [official Python SDK](https://github.com/Desearch-ai/desearch.py)
- Supports config-based and env var (`DESEARCH_API_KEY`) API key resolution
- Adds config UI labels and help text for DeSearch fields
- Adds 2 test cases for DeSearch config validation (full config + minimal config)
**Config example:**
```json
{
"tools": {
"web": {
"search": {
"provider": "desearch",
"desearch": {
"apiKey": "dt_...",
"baseUrl": "https://api.desearch.ai"
}
}
}
}
}
```
**Files changed:**
- `src/agents/tools/web-search.ts` — DeSearch provider logic, types, resolvers
- `src/config/schema.ts` — Field labels + help text
- `src/config/types.tools.ts` — TypeScript type for desearch config block
- `src/config/zod-schema.agent-runtime.ts` — Zod validation schema
- `src/config/config.web-search-provider.test.ts` — Config validation tests
Follows the same pattern as the existing Perplexity provider and the Tavily PR (#11978).
Refs: Discussion #5342
## Test plan
- [x] TypeScript type check passes (`tsc --noEmit` — exit 0)
- [x] All 972 test files pass (6680 tests, 0 failures)
- [x] New DeSearch config validation tests pass (2 tests)
- [ ] Manual test with DeSearch API key (set `provider: "desearch"` + `DESEARCH_API_KEY`)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
<!-- greptile_comment -->
<h2>Greptile Overview</h2>
<h3>Greptile Summary</h3>
This PR adds DeSearch as a third `web_search` provider alongside Brave and Perplexity. It extends config types/Zod schema/UI labels, resolves DeSearch credentials from config or `DESEARCH_API_KEY`, calls the DeSearch `/web` REST endpoint, and maps results into the existing `{title,url,description,published,siteName}` shape used by Brave.
Overall the integration follows the existing provider patterns and includes config validation tests for the new provider.
<h3>Confidence Score: 4/5</h3>
- Mostly safe to merge, but needs a security guardrail on configurable DeSearch baseUrl.
- Changes are localized and follow existing patterns with tests for config parsing. The main concern is that a user-configurable baseUrl is used for requests that include a raw API key in the Authorization header; without enforcing HTTPS, misconfiguration can leak credentials.
- src/agents/tools/web-search.ts
<!-- greptile_other_comments_section -->
<sub>(2/5) Greptile learns from your feedback when you react with thumbs up/down!</sub>
<!-- /greptile_comment -->
Most Similar PRs
#13814: feat(web-search): add ZAI Search (zsearch) provider
by strelov1 · 2026-02-11
82.6%
#14788: feat: Add DuckDuckGo search provider with Tor support
by emadomedher · 2026-02-12
79.0%
#8715: fix(web-search): safer provider resolution & Perplexity auto-detection
by abhijeet117 · 2026-02-04
78.5%
#11444: Add extensible search providers for web_search
by dhc02 · 2026-02-07
78.0%
#14393: feat: add standalone DeepSeek provider support
by osoulmate · 2026-02-12
78.0%
#10839: feat(web-search): add Bocha as a web search provider
by xiekeyang · 2026-02-07
77.6%
#13370: Tools: rewrite Grok parser, add Tavily provider, multi-provider con...
by a-anand-91119 · 2026-02-10
77.4%
#16895: feat(web-search): add SearXNG as a search provider
by rustyorb · 2026-02-15
77.2%
#13386: feat(web-search): add Nimble Web Search API provider
by ilchemla · 2026-02-10
77.1%
#13334: add local SearxNG integration for free unlimited web search
by itsPremkumar · 2026-02-10
76.9%