#17703: feat(web-search): add Parallel search provider
commands
agents
stale
size: M
Cluster:
Web Search Provider Enhancements
feat(web-search): add Parallel search provider
This PR adds support for Parallel (parallel.ai) as a web search provider alongside Brave, Perplexity, and Grok.
## Features
- New provider option: `tools.web.search.provider = "parallel"`
- Configurable mode: one-shot (default), agentic, or fast
- API key via `PARALLEL_API_KEY` env var or config
- CLI wizard support for easy configuration
## Configuration Example
```yaml
tools:
web:
search:
enabled: true
provider: parallel
parallel:
apiKey: "your-parallel-api-key"
mode: "one-shot" # one-shot | agentic | fast
maxResults: 10
maxCharsPerResult: 10000
```
## API Details
- Base URL: https://api.parallel.ai/v1beta
- Endpoint: /search
- Docs: https://docs.parallel.ai
## Files Changed
- `src/agents/tools/web-search.ts` - Core implementation
- `src/config/types.tools.ts` - Type definitions
- `src/config/zod-schema.agent-runtime.ts` - Schema validation
- `src/config/schema.help.ts` - Field metadata
- `src/commands/configure.wizard.ts` - CLI wizard support
<!-- greptile_comment -->
<h3>Greptile Summary</h3>
Adds Parallel (parallel.ai) as a fourth web search provider alongside Brave, Perplexity, and Grok. The implementation spans config types, Zod validation, schema help text, CLI wizard support, and the core search logic in `web-search.ts`.
- **Config & schema changes** (`types.tools.ts`, `zod-schema.agent-runtime.ts`, `schema.help.ts`): Clean additions that follow existing patterns for Perplexity and Grok. Parallel config supports `apiKey`, `baseUrl`, `mode` (one-shot/agentic/fast), `maxResults`, and excerpt limits.
- **CLI wizard** (`configure.wizard.ts`): Well-structured refactoring that upgrades the wizard from Brave-only to a multi-provider selector with per-provider key prompts and a Parallel mode selector.
- **Core implementation** (`web-search.ts`): Adds the `runParallelSearch` function, config resolvers, and result mapping. One cache key issue found: excerpt config (`maxCharsPerResult`, `maxCharsTotal`) is omitted from the Parallel cache key, which could cause stale results if these values differ between tool instances sharing the module-level `SEARCH_CACHE`. The file has grown to 998 LOC (project guideline is ~700 LOC); consider extracting per-provider logic into separate modules in a follow-up.
- **Tests**: The new `resolveParallel*` functions are exported via `__testing` but the existing test file (`web-search.e2e.test.ts`) doesn't import or test them. Adding unit tests would improve confidence in the config resolution logic.
<h3>Confidence Score: 3/5</h3>
- This PR is likely safe to merge but has a cache key bug and lacks test coverage for the new provider logic.
- The implementation follows existing patterns well and the config/schema/wizard changes are clean. Score is 3 rather than higher due to: (1) a cache key bug where Parallel excerpt configuration is not included, risking stale cached results; (2) no unit tests for the newly exported resolver functions; (3) two previously flagged security issues (missing externalContent metadata and unwrapped raw excerpts) that still need addressing.
- Pay close attention to `src/agents/tools/web-search.ts` — specifically the cache key construction (line 715) and the result mapping block (lines 793-815) where previously flagged security issues exist.
<sub>Last reviewed commit: 5c2e8cf</sub>
<!-- greptile_other_comments_section -->
**Context used:**
- Context from `dashboard` - CLAUDE.md ([source](https://app.greptile.com/review/custom-context?memory=fd949e91-5c3a-4ab5-90a1-cbe184fd6ce8))
<!-- /greptile_comment -->
Most Similar PRs
#17729: fix(configure): update web tools hint to reflect all search providers
by raktim-mondol · 2026-02-16
81.8%
#7738: feat(web-search): add provider fallback and Serper support
by garnetlyx · 2026-02-03
78.7%
#17632: feat(web-search): add per-call provider override
by cog-bernthiddema · 2026-02-16
78.6%
#8715: fix(web-search): safer provider resolution & Perplexity auto-detection
by abhijeet117 · 2026-02-04
76.9%
#13370: Tools: rewrite Grok parser, add Tavily provider, multi-provider con...
by a-anand-91119 · 2026-02-10
76.6%
#12304: feat: add DeSearch as web_search provider
by tatjr13 · 2026-02-09
76.5%
#11444: Add extensible search providers for web_search
by dhc02 · 2026-02-07
76.1%
#18167: feat(web-search): add baseUrl support for Brave Search provider
by jkoprax · 2026-02-16
76.0%
#13386: feat(web-search): add Nimble Web Search API provider
by ilchemla · 2026-02-10
76.0%
#13814: feat(web-search): add ZAI Search (zsearch) provider
by strelov1 · 2026-02-11
75.7%