You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Reacted by Nived Prakash, Nick Poorman, D-James-GH, Christoph Waffler, Eugene Kim, Tommy D. Rossi, JAZZ CABBAGE, Michael Holtzscher, Chindriș Mihai - Alexandru, Ricardo Martin Marcucci and 19 more
Does this exist now? I see websearch.txt, but no corresponding websearch.ts implementation? (And websearch -> "Search" styling) @rekram1-node, can you point me to what closed this?
The title of the issue and contents of websearch.txt refer to actual search functionality rather than the web fetching supported by that tool.
Should a different issue be opened?
Though maybe web search should be left to MCP servers since there are few (if any?) free APIs for it?
I can open a PR to add websearch tool using Gemini search grounding tool, which can search and fetch pages and make a summary, very similar to how Claude Code works
This tool would be enabled only for users that logged in with Gemini
I've been using the python lib/cli ddgs with a lightweight local MCP wrapper and it's fantastic so far. Much faster & precise results for agent web searches than the builtin Cursor websearch I was using before. Note that the npm package by the same name is not a direct analog and lacks many of the features. I could take a crack at creating a direct typescript port of the python implementation if y'all were interested in integrating advanced search functionality.
Reacted by Chindriș Mihai - Alexandru and bf-frieder
I've run OPENCODE_ENABLE_EXA=true opencode without API key (and without Zen either) and it worked 🤷
I did not see anything about setting an API key in the opencode source code.
I guess there is a free tier or something like that?
Reacted by Abílio Costa, Vinicius Fortuna, Thierry Santos, Stanislas, Fernando Mumbach, Osinachi Okpara, Mike, Phillipe Lopes, rich-jojo, Yuxiang Zhao and 1 more
I was surprised there was no search, so cooked a quick tool for opencode to use codex w/ search enabled to do some webresearch. I suppose it's a bit like amp's "Librarian" but with a bad ui. Anyway, it's working for me.
Sharing in case it's helpful for someone else
//.opencode/tool/webresearch.tsimport{tool}from"@opencode-ai/plugin";constQUALITY_PRESETS={fast: {effort: "low",directive: "Keep it quick; use only the most relevant sources.",},balanced: {effort: "medium",directive: "Cover the main angles; resolve contradictions if they appear.",},deep: {effort: "high",directive:
"Follow second-order leads and resolve contradictions until extra sources stop adding value.",},}asconst;typeQuality=keyoftypeofQUALITY_PRESETS;functionbuildPrompt({
reason,
query,
additionalContext,
quality,}: {reason: string;query: string;additionalContext?: string;quality: Quality;}){constpreset=QUALITY_PRESETS[quality];constcontextBlock=additionalContext
? `Additional context (optional): ${additionalContext}`
: "Additional context (optional):";return["Hi, I’m stuck and need help with a research task.","",`Reason: ${reason}`,`Search queries: ${query}`,contextBlock,`Depth: ${quality}`,"","Please search the web and send back:","- A 2-4 sentence summary","- Key findings or caveats (bullets)","- Sources with full URLs","","If anything is ambiguous, cover the plausible interpretations and state your assumptions instead of asking questions.","Please don’t edit any code or files.",preset.directive,].join("\n");}asyncfunctionrunCodex({
prompt,
effort,
timeoutSeconds,}: {prompt: string;effort: string;timeoutSeconds?: number;}){constargs=["exec","--enable","web_search_request","--sandbox","read-only","-c",`model_reasoning_effort=${effort}`,prompt,];constproc=Bun.spawn(["codex", ...args],{stdout: "pipe",stderr: "pipe",});lettimeoutId: ReturnType<typeofsetTimeout>|undefined;if(timeoutSeconds&&timeoutSeconds>0){timeoutId=setTimeout(()=>{proc.kill();},Math.round(timeoutSeconds*1000),);}const[stdout,stderr]=awaitPromise.all([newResponse(proc.stdout).text(),newResponse(proc.stderr).text(),]);constexitCode=awaitproc.exited;if(timeoutId){clearTimeout(timeoutId);}if(exitCode!==0){constmessage=stderr.trim()||`codex exec failed with exit code ${exitCode}`;thrownewError(message);}returnstdout.trim();}exportdefaulttool({description:
"Run a web search and return a concise summary with source links. Use when you need current, verifiable information or citations.",args: {reason: tool.schema.string().describe("Describe the core reason you’re reaching for web search and the decision or output you’re aiming for.",),query: tool.schema.string().describe('List the search queries you want run; use new lines or ";" to include multiple angles.',),additional_context: tool.schema.string().optional().describe("Add constraints or background: versions, product names, prior findings, relevant files/code, or must-include sources.",),quality: tool.schema.enum(["fast","balanced","deep"]).describe("Fast = quick scan, balanced = normal depth, deep = thorough with follow-up leads.",),timeout: tool.schema.number().optional().describe("Optional max seconds to cap the search."),},asyncexecute(args){constquality=args.qualityasQuality;constprompt=buildPrompt({reason: args.reason,query: args.query,additionalContext: args.additional_context,
quality,});consteffort=QUALITY_PRESETS[quality].effort;returnrunCodex({
prompt,
effort,timeoutSeconds: args.timeout,});},});
I'm hitting 429 when using it and can't debug the request/response because the provider is missing log.debug calls (actually no logging). Would be nice to add them to debug these issues. probably the server response tells something
It seems that the web search is still not working due to rate limiting (429 error
Btw, different web search tools aren’t the same; e.g., some may be blocked from certain websites, and others can differ in their summarization results versus returning the actual raw content – it’d be really nice to have something universal that could fall back through the different available tools, suitable for the specific request. In the ideal case, even using the compatible MCP tools as well.
I'm using DuckDuckGo search MCP, and it often provides better results and is free. But models from all the different providers tend to forget to try it without my explicit command even after they have failed the request using the default web access tools.
Reacted by Nicolas K., Stefan Weber and Art Shendrik
I keep getting aggressively rate limited, so I got an api key with exa, but I can't figure out where to put it. I put it in the environment under EXA_API_KEY, I put it in a new mcp server config, nothing works. It's clear to me from reading the docs that the only simple way to get actually reliable web search is to pay opencode for it, despite the fact that I already pay for web search built into my current ai provider.
I keep getting aggressively rate limited, so I got an api key with exa, but I can't figure out where to put it. I put it in the environment under EXA_API_KEY, I put it in a new mcp server config, nothing works. It's clear to me from reading the docs that the only simple way to get actually reliable web search is to pay opencode for it, despite the fact that I already pay for web search built into my current ai provider.
@jaded0
if you npm install from source code, then modify here you can use your own api key.
It is more convenient if opencode can provide an easier way to set different web search tools and use our own api keys to prevent rate limit.
For now, I guess we can create our custom websearch tool and disable the default one if we want to use a different web search tool like Tavily. Personally, I feel Tavily is better than Exa.
Reacted by Jaden, Sergey Kostrukov and George Shao
Activity
garrett-hopper commentedon Aug 29, 2025
Does this exist now? I see
websearch.txt, but no correspondingwebsearch.tsimplementation? (Andwebsearch->"Search"styling)@rekram1-node, can you point me to what closed this?
rekram1-node commentedon Aug 29, 2025
@garrett-hopper https://github.com/sst/opencode/blob/dev/packages/opencode/src/tool/webfetch.ts
garrett-hopper commentedon Aug 29, 2025
The title of the issue and contents of websearch.txt refer to actual search functionality rather than the web fetching supported by that tool.
Should a different issue be opened?
Though maybe web search should be left to MCP servers since there are few (if any?) free APIs for it?
rekram1-node commentedon Aug 29, 2025
Ig you are correct they are different
remorses commentedon Sep 9, 2025
I can open a PR to add websearch tool using Gemini search grounding tool, which can search and fetch pages and make a summary, very similar to how Claude Code works
This tool would be enabled only for users that logged in with Gemini
PR welcome?
garrett-hopper commentedon Sep 9, 2025
Curious if Claude Code's builtin search could be used as well in a similar fashion for those using Anthropic Pro/Max logins. 🤔
Would probably be ideal to have support for the providers' builtin tools when possible. Groq has builtin Exa search tool (https://console.groq.com/docs/browser-search) for openai/gpt-oss-120b and Tavily for their compound models (https://console.groq.com/docs/web-search). Not sure how difficult it'd be to support any/all of these.
eugene-kim commentedon Sep 12, 2025
@adamdotdevin @thdxr is search something opencode is planning on adding?
trose commentedon Sep 22, 2025
I've been using the python lib/cli ddgs with a lightweight local MCP wrapper and it's fantastic so far. Much faster & precise results for agent web searches than the builtin Cursor websearch I was using before. Note that the npm package by the same name is not a direct analog and lacks many of the features. I could take a crack at creating a direct typescript port of the python implementation if y'all were interested in integrating advanced search functionality.
nikaro commentedon Dec 23, 2025
I can see that currently there are
websearchandcodesearchtools behind theOPENCODE_ENABLE_EXAflag. It uses the Exa API under the hood.garrett-hopper commentedon Dec 23, 2025
Is that
OPENCODE_ENABLE_EXAZen only or can I provide my own Exa API key?nikaro commentedon Dec 24, 2025
I've run
OPENCODE_ENABLE_EXA=true opencodewithout API key (and without Zen either) and it worked 🤷I did not see anything about setting an API key in the opencode source code.
I guess there is a free tier or something like that?
1 remaining item
brennanmceachran commentedon Dec 31, 2025
I was surprised there was no search, so cooked a quick tool for opencode to use codex w/ search enabled to do some webresearch. I suppose it's a bit like amp's "Librarian" but with a bad ui. Anyway, it's working for me.
Sharing in case it's helpful for someone else
rakibdev commentedon Jan 3, 2026
existing exa search is great. feels more accurate than google search. doesn't even require api key, impressive
scratchmex commentedon Jan 5, 2026
I'm hitting 429 when using it and can't debug the request/response because the provider is missing log.debug calls (actually no logging). Would be nice to add them to debug these issues. probably the server response tells something
lopi-py commentedon Jan 12, 2026
Might be worth to auto enable it if a zen auth was detected?
angristan commentedon Jan 18, 2026
I would expect opencode to support the models' native search tool instead of using a 3rd party API, e.g.:
lopi-py commentedon Jan 18, 2026
Do these consume credits if used with API key?
art-shen commentedon Jan 19, 2026
Of course 😃
Btw, different web search tools aren’t the same; e.g., some may be blocked from certain websites, and others can differ in their summarization results versus returning the actual raw content – it’d be really nice to have something universal that could fall back through the different available tools, suitable for the specific request. In the ideal case, even using the compatible MCP tools as well.
I'm using DuckDuckGo search MCP, and it often provides better results and is free. But models from all the different providers tend to forget to try it without my explicit command even after they have failed the request using the default web access tools.
skwde commentedon Jan 30, 2026
@art-shen It would be nice if you could add your DuckDuckGo MCP setup to the opencode docs: https://opencode.ai/docs/mcp-servers/#examples
art-shen commentedon Jan 30, 2026
@skwde, check it out: #11297
jaded0 commentedon Feb 14, 2026
I keep getting aggressively rate limited, so I got an api key with exa, but I can't figure out where to put it. I put it in the environment under EXA_API_KEY, I put it in a new mcp server config, nothing works. It's clear to me from reading the docs that the only simple way to get actually reliable web search is to pay opencode for it, despite the fact that I already pay for web search built into my current ai provider.
DeepForget commentedon Mar 2, 2026
@jaded0
if you npm install from source code, then modify here you can use your own api key.
It is more convenient if opencode can provide an easier way to set different web search tools and use our own api keys to prevent rate limit.
For now, I guess we can create our custom websearch tool and disable the default one if we want to use a different web search tool like Tavily. Personally, I feel Tavily is better than Exa.
Merge pull request anomalyco#309 from cookiee339/feat/kotlin-ecosystem
github-actions commentedon May 2, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.
feat(owpenbot): add send command and sidecar integration (anomalyco#309)