Skip to content

feat: add Synthetic web search backend to websearch tool #41164

Description

@Qiiks

Feature request

The built-in websearch tool supports exactly two backends — exa and parallel — hardcoded in WebSearchProviderSchema in tool/websearch.ts. Synthetic (synthetic.new) provides a zero-data-retention web search API (POST https://api.synthetic.new/v2/search, returns {results: [{url, title, text, published}]}) explicitly designed for coding agents, but there is no way to route opencode's websearch tool to it.

Proposed behavior

Add "synthetic" as a third web search provider:

  • WebSearchProviderSchema gains "synthetic", selectWebSearchProvider handles it (env override + flag + checksum fallback)
  • callProvider POSTs to https://api.synthetic.new/v2/search with Bearer auth and formats results (url/title/text)
  • Auto-enabled when the synthetic provider is authed (auth store) or SYNTHETIC_API_KEY env is set, or explicitly via OPENCODE_ENABLE_SYNTHETIC_SEARCH=1

Why

  • Web search is decoupled from LLM provider auth today — the tool never looks at which provider is authed, so a user with a Synthetic key can't use Synthetic's search without a plugin.
  • Synthetic's search is zero-data-retention, which is a meaningful privacy property for coding-agent search.
  • The callProvider() switch is the intended extension point — this is a clean third case following the exa/parallel pattern.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions