The open source coding agent.
TypeScript
feat: restore experimental flag for websearch/codesearch tools (#5132)
Ben Vargas419983c0f1dc
diff --git a/packages/opencode/src/flag/flag.ts b/packages/opencode/src/flag/flag.tsindex 9a3d0437be5..924f585c475 100644--- a/packages/opencode/src/flag/flag.ts+++ b/packages/opencode/src/flag/flag.ts@@ -18,6 +18,8 @@ export namespace Flag {export const OPENCODE_EXPERIMENTAL = truthy("OPENCODE_EXPERIMENTAL")export const OPENCODE_EXPERIMENTAL_WATCHER = OPENCODE_EXPERIMENTAL || truthy("OPENCODE_EXPERIMENTAL_WATCHER")export const OPENCODE_EXPERIMENTAL_DISABLE_COPY_ON_SELECT = truthy("OPENCODE_EXPERIMENTAL_DISABLE_COPY_ON_SELECT")+ export const OPENCODE_ENABLE_EXA =+ truthy("OPENCODE_ENABLE_EXA") || OPENCODE_EXPERIMENTAL || truthy("OPENCODE_EXPERIMENTAL_EXA")function truthy(key: string) {const value = process.env[key]?.toLowerCase()diff --git a/packages/opencode/src/tool/registry.ts b/packages/opencode/src/tool/registry.tsindex 33a54675ffa..7e440a78aa5 100644--- a/packages/opencode/src/tool/registry.ts+++ b/packages/opencode/src/tool/registry.ts@@ -113,7 +113,10 @@ export namespace ToolRegistry {const result = await Promise.all(tools.filter((t) => {- if (t.id === "codesearch" || t.id === "websearch") return providerID === "opencode"+ // Enable websearch/codesearch for zen users OR via enable flag+ if (t.id === "codesearch" || t.id === "websearch") {+ return providerID === "opencode" || Flag.OPENCODE_ENABLE_EXA+ }return true}).map(async (t) => ({