Rotating web search for OpenCode: provider-native search with Exa/Parallel/Google fallback
  • JavaScript 100%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-10-02 07:40:55 +02:00
lib fix(anthropic): bump claude-cli UA to 2.1.280 for opus 5.5 gate 2026-10-02 07:40:55 +02:00
vendor refactor: zero-dep plain js with vendored schema toolkit 2026-09-17 13:47:47 +02:00
.gitignore refactor: zero-dep plain js with vendored schema toolkit 2026-09-17 13:47:47 +02:00
index.js fix(websearch): gate native tier and fallback auth failures gracefully 2026-09-24 02:44:22 +02:00
package.json refactor: zero-dep plain js with vendored schema toolkit 2026-09-17 13:47:47 +02:00
README.md fix(websearch): gate native tier and fallback auth failures gracefully 2026-09-24 02:44:22 +02:00

duh-websearch

Rotating web search tool for OpenCode. Chains native provider search → exa → parallel → google_search, falling through tiers on failure. Every result carries metadata.provider (e.g. native:zai, exa) so you always know who answered. Keyless exa/parallel MCP tiers mean the tool works out of the box with no API keys.

Install

git clone <repo-url>
// opencode.jsonc → "plugin"
"plugin": ["file:<clone-dir>/duh-websearch"]

Restart opencode. No install, no build, no deps.

Options

// pin a tier: native | exa | parallel | google
["file:<clone-dir>/duh-websearch", { "provider": "native" }]
// custom duh-agy-auth location
["file:<clone-dir>/duh-websearch", { "googleSearchPath": "/path/to/duh-agy-auth" }]

Tiers

  • z.ai — web_search_prime MCP using the stored zai-coding-plan key or ZAI_API_KEY
  • anthropic — provider API key, or Claude OAuth via the duh-claude-auth store
  • chatgpt — OpenCode ChatGPT OAuth, codex backend (only native tier with TUI fallback warnings)
  • exa / parallel — keyless hosted MCP, no key required
  • google_search — sibling duh-agy-auth cloned side-by-side, or googleSearchPath

Raw openai API keys never attempt native; the tier skips silently to exa/parallel. Placeholder keys (e.g. public) are treated as missing.

401/403 fall through to the next tier with a one-time-per-session TUI warning; 400 capability misses, 429/5xx, and network failures also fall through; missing credentials skip a tier silently (native skips warn once per session).

Tool args: query, allowed_domains, blocked_domains (mutually exclusive), numResults, type, livecrawl, contextMaxCharacters, recency.