Skip to content

Commit 9c237f0

Browse files
committed
temporarily restrict codesearch and websearch to opencode zen users. need to figure out how to opt out for enterprise users who do not want this
1 parent 63bfe76 commit 9c237f0

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

packages/opencode/src/tool/registry.ts

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -108,13 +108,18 @@ export namespace ToolRegistry {
108108
return all().then((x) => x.map((t) => t.id))
109109
}
110110

111-
export async function tools(_providerID: string, _modelID: string) {
111+
export async function tools(providerID: string, _modelID: string) {
112112
const tools = await all()
113113
const result = await Promise.all(
114-
tools.map(async (t) => ({
115-
id: t.id,
116-
...(await t.init()),
117-
})),
114+
tools
115+
.filter((t) => {
116+
if (t.id === "codesearch" || t.id === "websearch") return providerID === "opencode"
117+
return true
118+
})
119+
.map(async (t) => ({
120+
id: t.id,
121+
...(await t.init()),
122+
})),
118123
)
119124
return result
120125
}

0 commit comments

Comments
 (0)