Skip to content

Commit 419983c

Browse files
ben-vargasopencode-agent[bot]rekram1-node
authored
feat: restore experimental flag for websearch/codesearch tools (#5132)
Co-authored-by: opencode-agent[bot] <opencode-agent[bot]@users.noreply.github.com> Co-authored-by: rekram1-node <[email protected]>
1 parent a59c80e commit 419983c

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

packages/opencode/src/flag/flag.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ export namespace Flag {
1818
export const OPENCODE_EXPERIMENTAL = truthy("OPENCODE_EXPERIMENTAL")
1919
export const OPENCODE_EXPERIMENTAL_WATCHER = OPENCODE_EXPERIMENTAL || truthy("OPENCODE_EXPERIMENTAL_WATCHER")
2020
export const OPENCODE_EXPERIMENTAL_DISABLE_COPY_ON_SELECT = truthy("OPENCODE_EXPERIMENTAL_DISABLE_COPY_ON_SELECT")
21+
export const OPENCODE_ENABLE_EXA =
22+
truthy("OPENCODE_ENABLE_EXA") || OPENCODE_EXPERIMENTAL || truthy("OPENCODE_EXPERIMENTAL_EXA")
2123

2224
function truthy(key: string) {
2325
const value = process.env[key]?.toLowerCase()

packages/opencode/src/tool/registry.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,10 @@ export namespace ToolRegistry {
113113
const result = await Promise.all(
114114
tools
115115
.filter((t) => {
116-
if (t.id === "codesearch" || t.id === "websearch") return providerID === "opencode"
116+
// Enable websearch/codesearch for zen users OR via enable flag
117+
if (t.id === "codesearch" || t.id === "websearch") {
118+
return providerID === "opencode" || Flag.OPENCODE_ENABLE_EXA
119+
}
117120
return true
118121
})
119122
.map(async (t) => ({

0 commit comments

Comments
 (0)