#10839: feat(web-search): add Bocha as a web search provider
agents
stale
Cluster:
Web Search Provider Enhancements
## Summary
- Add **Bocha** ([bocha.cn](https://bocha.cn)) as a third web search provider alongside Brave and Perplexity
- Bocha provides real-time web search with strong support for Chinese language content
- Implements the same `SearchResult` interface pattern used by existing providers
## Configuration
| Key | Description |
|---|---|
| `tools.web.search.provider` | Set to `"bocha"` |
| `tools.web.search.bocha.apiKey` | API key (or set `BOCHA_API_KEY` env var) |
| `tools.web.search.bocha.baseUrl` | Defaults to `https://api.bocha.cn/v1/web-search` |
## Files changed
- `src/agents/tools/web-search.ts` — Bocha provider implementation
- `src/config/schema.ts` — field help text for Bocha config
- `src/config/types.tools.ts` — TypeScript types for Bocha options
- `src/config/zod-schema.agent-runtime.ts` — Zod validation for Bocha config
## Test plan
- [ ] Verify `pnpm build` passes with the new provider types
- [ ] Verify `pnpm check` (lint/format) passes
- [ ] Verify `pnpm test` passes
- [ ] Manual test: configure Bocha provider and run a web search query
🤖 Generated with [Claude Code](https://claude.com/claude-code)
<!-- greptile_comment -->
<h2>Greptile Overview</h2>
<h3>Greptile Summary</h3>
- Adds a third `web_search` provider (Bocha) alongside Brave and Perplexity, including request/response mapping and config resolution.
- Extends config help text, TypeScript config types, and runtime Zod validation to support `tools.web.search.bocha.*`.
- Integrates Bocha results into the existing `SearchResult`-style payload returned by `web_search` and reuses the shared caching/timeout utilities.
<h3>Confidence Score: 3/5</h3>
- This PR is close to mergeable but has correctness issues around Bocha endpoint handling and caching behavior.
- Core wiring (provider selection, config schema/types, request mapping) is consistent with existing providers, but the Bocha `baseUrl` semantics are inconsistent with the help text and can cause guaranteed request failures depending on how users configure it. Additionally, cache keys for non-Brave providers don’t include provider-specific base URLs, so config changes can yield incorrect cached responses.
- 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
80.3%
#12304: feat: add DeSearch as web_search provider
by tatjr13 · 2026-02-09
77.6%
#14788: feat: Add DuckDuckGo search provider with Tor support
by emadomedher · 2026-02-12
76.5%
#13366: Add baidu search as web tools provider
by ide-rea · 2026-02-10
75.4%
#17729: fix(configure): update web tools hint to reflect all search providers
by raktim-mondol · 2026-02-16
75.2%
#13370: Tools: rewrite Grok parser, add Tavily provider, multi-provider con...
by a-anand-91119 · 2026-02-10
74.6%
#18167: feat(web-search): add baseUrl support for Brave Search provider
by jkoprax · 2026-02-16
73.9%
#19126: feat(web-search): add baseUrl option for Brave Search provider
by pierreeurope · 2026-02-17
73.3%
#17632: feat(web-search): add per-call provider override
by cog-bernthiddema · 2026-02-16
73.3%
#17703: feat(web-search): add Parallel search provider
by raktim-mondol · 2026-02-16
73.2%