Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions packages/app/src/i18n/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1099,8 +1099,6 @@ export const dict = {
"settings.permissions.tool.webfetch.description": "Fetch content from a URL",
"settings.permissions.tool.websearch.title": "Web Search",
"settings.permissions.tool.websearch.description": "Search the web",
"settings.permissions.tool.codesearch.title": "Code Search",
"settings.permissions.tool.codesearch.description": "Search code on the web",
"settings.permissions.tool.external_directory.title": "External Directory",
"settings.permissions.tool.external_directory.description": "Access files outside the project directory",
"settings.permissions.tool.doom_loop.title": "Doom Loop",
Expand Down
2 changes: 0 additions & 2 deletions packages/app/src/i18n/zh.ts
Original file line number Diff line number Diff line change
Expand Up @@ -980,8 +980,6 @@ export const dict = {
"settings.permissions.tool.webfetch.description": "从 URL 获取内容",
"settings.permissions.tool.websearch.title": "网页搜索",
"settings.permissions.tool.websearch.description": "搜索网页",
"settings.permissions.tool.codesearch.title": "代码搜索",
"settings.permissions.tool.codesearch.description": "在网上搜索代码",
"settings.permissions.tool.external_directory.title": "外部目录",
"settings.permissions.tool.external_directory.description": "访问项目目录之外的文件",
"settings.permissions.tool.doom_loop.title": "死循环",
Expand Down
1 change: 0 additions & 1 deletion packages/opencode/specs/effect-migration.md
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,6 @@ Individual tools, ordered by value:
- [ ] `edit.ts` — HIGH: multi-step diff/format/publish pipeline, FileWatcher lock
- [ ] `grep.ts` — MEDIUM: spawns ripgrep → ChildProcessSpawner, timeout handling
- [ ] `write.ts` — MEDIUM: permission checks, diagnostics polling, Bus events
- [ ] `codesearch.ts` — MEDIUM: HTTP + SSE + manual timeout → HttpClient + Effect.timeout
- [ ] `webfetch.ts` — MEDIUM: fetch with UA retry, size limits → HttpClient
- [ ] `websearch.ts` — MEDIUM: MCP over HTTP → HttpClient
- [ ] `batch.ts` — MEDIUM: parallel execution, per-call error recovery → Effect.all
Expand Down
1 change: 0 additions & 1 deletion packages/opencode/src/agent/agent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,6 @@ export namespace Agent {
bash: "allow",
webfetch: "allow",
websearch: "allow",
codesearch: "allow",
read: "allow",
external_directory: {
"*": "allow",
Expand Down
9 changes: 0 additions & 9 deletions packages/opencode/src/cli/cmd/run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import { ReadTool } from "../../tool/read"
import { WebFetchTool } from "../../tool/webfetch"
import { EditTool } from "../../tool/edit"
import { WriteTool } from "../../tool/write"
import { CodeSearchTool } from "../../tool/codesearch"
import { WebSearchTool } from "../../tool/websearch"
import { AgentTool } from "../../tool/agent"
import { SkillTool } from "../../tool/skill"
Expand Down Expand Up @@ -153,13 +152,6 @@ function edit(info: ToolProps<typeof EditTool>) {
)
}

function codesearch(info: ToolProps<typeof CodeSearchTool>) {
inline({
icon: "◇",
title: `Exa Code Search "${info.input.query}"`,
})
}

function websearch(info: ToolProps<typeof WebSearchTool>) {
inline({
icon: "◈",
Expand Down Expand Up @@ -428,7 +420,6 @@ export const RunCommand = cmd({
if (part.tool === "write") return write(props<typeof WriteTool>(part))
if (part.tool === "webfetch") return webfetch(props<typeof WebFetchTool>(part))
if (part.tool === "edit") return edit(props<typeof EditTool>(part))
if (part.tool === "codesearch") return codesearch(props<typeof CodeSearchTool>(part))
if (part.tool === "websearch") return websearch(props<typeof WebSearchTool>(part))
if (isAgentToolPart(part.tool)) return agent(props<typeof AgentTool>(part))
if (part.tool === "todowrite") return todo(props<typeof TodoWriteTool>(part))
Expand Down
2 changes: 0 additions & 2 deletions packages/opencode/src/config/permission.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ const InputObject = Schema.StructWithRest(
question: Schema.optional(Action),
webfetch: Schema.optional(Action),
websearch: Schema.optional(Action),
codesearch: Schema.optional(Action),
lsp: Schema.optional(Rule),
doom_loop: Schema.optional(Action),
skill: Schema.optional(Rule),
Expand Down Expand Up @@ -76,7 +75,6 @@ const InfoZod = z
question: zod(Action).optional(),
webfetch: zod(Action).optional(),
websearch: zod(Action).optional(),
codesearch: zod(Action).optional(),
lsp: zod(Rule).optional(),
doom_loop: zod(Action).optional(),
skill: zod(Rule).optional(),
Expand Down
62 changes: 0 additions & 62 deletions packages/opencode/src/tool/codesearch.ts

This file was deleted.

12 changes: 0 additions & 12 deletions packages/opencode/src/tool/codesearch.txt

This file was deleted.

2 changes: 1 addition & 1 deletion packages/opencode/src/tool/question.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Use this tool proactively when you need a user decision that meaningfully shapes

- Factual lookups you can answer by reading code, docs, or running a command.
- The user already gave a specific instruction; just execute it.
- Pure exploration tasks (use the explore agent or codesearch instead).
- Pure exploration tasks (use the explore agent or search tools instead).
- Trivial style choices a sensible default covers.
- Confirmation theater: don't ask "should I proceed?" after the user already said proceed.

Expand Down
7 changes: 0 additions & 7 deletions packages/opencode/src/tool/registry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import { Plugin } from "../plugin"
import { Provider } from "../provider/provider"
import { ProviderID, type ModelID } from "../provider/schema"
import { WebSearchTool } from "./websearch"
import { CodeSearchTool } from "./codesearch"
import { Flag } from "@opencode-ai/core/flag/flag"
import { Settings } from "@/settings"
import { Log } from "@opencode-ai/core/util/log"
Expand Down Expand Up @@ -135,7 +134,6 @@ export namespace ToolRegistry {
const webfetch = yield* WebFetchTool
const websearch = yield* WebSearchTool
const bash = yield* BashTool
const codesearch = yield* CodeSearchTool
const globtool = yield* GlobTool
const writetool = yield* WriteTool
const edit = yield* EditTool
Expand Down Expand Up @@ -272,7 +270,6 @@ export namespace ToolRegistry {
fetch: Tool.init(webfetch),
todo: Tool.init(todo),
search: Tool.init(websearch),
code: Tool.init(codesearch),
skill: Tool.init(skilltool),
patch: Tool.init(patchtool),
question: Tool.init(question),
Expand All @@ -299,7 +296,6 @@ export namespace ToolRegistry {
tool.fetch,
tool.todo,
...(webSearchEnabled ? [tool.search] : []),
tool.code,
tool.skill,
tool.patch,
...(lspEnabled ? [tool.lsp] : []),
Expand Down Expand Up @@ -360,9 +356,6 @@ export namespace ToolRegistry {
const webSearchEnabled = yield* settings.webSearchEnabled()
const filtered = (yield* all()).filter((tool) => {
if (tool.id === WebSearchTool.id) return webSearchEnabled
if (tool.id === CodeSearchTool.id) {
return input.providerID === ProviderID.opencode || Flag.OPENCODE_ENABLE_EXA
}

const usePatch =
!!Env.get("OPENCODE_E2E_LLM_URL") ||
Expand Down
23 changes: 0 additions & 23 deletions packages/opencode/test/tool/__snapshots__/parameters.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -58,29 +58,6 @@ Output: Creates directory 'foo'"
}
`;

exports[`tool parameters JSON Schema (wire shape) codesearch 1`] = `
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"properties": {
"query": {
"description": "Search query to find relevant context for APIs, Libraries, and SDKs. For example, 'React useState hook examples', 'Python pandas dataframe filtering', 'Express.js middleware', 'Next js partial prerendering configuration'",
"type": "string",
},
"tokensNum": {
"default": 5000,
"description": "Number of tokens to return (1000-50000). Default is 5000 tokens. Adjust this value based on how much context you need - use lower values for focused queries and higher values for comprehensive documentation.",
"maximum": 50000,
"minimum": 1000,
"type": "number",
},
},
"required": [
"query",
],
"type": "object",
}
`;

exports[`tool parameters JSON Schema (wire shape) edit 1`] = `
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
Expand Down
13 changes: 12 additions & 1 deletion packages/opencode/test/tool/registry.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -549,6 +549,17 @@ describe("tool.registry", () => {
})
})

test("does not register broken codesearch tool", async () => {
await using tmp = await tmpdir()
await Instance.provide({
directory: tmp.path,
fn: async () => {
const ids = await ToolRegistry.ids()
expect(ids).not.toContain("codesearch")
},
})
})

test("includes lsp tool when Settings.lspEnabled=true", async () => {
await using tmp = await tmpdir()
await Settings.setLspEnabled(true)
Expand Down Expand Up @@ -591,7 +602,7 @@ describe("tool.registry", () => {
}
})

test("exposes websearch for non-opencode providers by default while codesearch stays gated", async () => {
test("exposes websearch for non-opencode providers without codesearch", async () => {
await using tmp = await tmpdir()
const previous = await Settings.webSearchEnabled()
try {
Expand Down
1 change: 0 additions & 1 deletion packages/sdk/js/src/v2/gen/types.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1368,7 +1368,6 @@ export type PermissionConfig =
question?: PermissionActionConfig
webfetch?: PermissionActionConfig
websearch?: PermissionActionConfig
codesearch?: PermissionActionConfig
lsp?: PermissionRuleConfig
doom_loop?: PermissionActionConfig
skill?: PermissionRuleConfig
Expand Down
5 changes: 1 addition & 4 deletions packages/sdk/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -11198,9 +11198,6 @@
"websearch": {
"$ref": "#/components/schemas/PermissionActionConfig"
},
"codesearch": {
"$ref": "#/components/schemas/PermissionActionConfig"
},
"lsp": {
"$ref": "#/components/schemas/PermissionRuleConfig"
},
Expand Down Expand Up @@ -14167,4 +14164,4 @@
}
}
}
}
}
32 changes: 0 additions & 32 deletions packages/ui/src/components/message-part.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -346,12 +346,6 @@ export function getToolInfo(tool: string, input: any = {}, metadata: any = {}):
title: i18n.t("ui.tool.websearch"),
subtitle: input.query,
}
case "codesearch":
return {
icon: "code",
title: i18n.t("ui.tool.codesearch"),
subtitle: input.query,
}
case "enter-worktree": {
return {
icon: "worktree",
Expand Down Expand Up @@ -1760,32 +1754,6 @@ ToolRegistry.register({
},
})

ToolRegistry.register({
name: "codesearch",
render(props) {
const i18n = useI18n()
const query = createMemo(() => {
const value = props.input.query
if (typeof value !== "string") return ""
return value
})

return (
<BasicTool
{...props}
icon="code"
trigger={{
title: i18n.t("ui.tool.codesearch"),
subtitle: query(),
subtitleClass: "exa-tool-query",
}}
>
<ExaOutput output={props.output} />
</BasicTool>
)
},
})

ToolRegistry.register({
name: "enter-worktree",
render(props) {
Expand Down
6 changes: 1 addition & 5 deletions packages/ui/src/components/tool-error-card.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,6 @@ const samples = [
tool: "websearch",
error: "websearch Rate limited: Please try again in 30 seconds",
},
{
tool: "codesearch",
error: "codesearch Timeout: exceeded 120s",
},
{
tool: "question",
error: "question Dismissed: user dismissed this question",
Expand All @@ -72,7 +68,7 @@ export default {
argTypes: {
tool: {
control: "select",
options: ["apply_patch", "bash", "read", "glob", "grep", "webfetch", "websearch", "codesearch", "question"],
options: ["apply_patch", "bash", "read", "glob", "grep", "webfetch", "websearch", "question"],
},
error: {
control: "text",
Expand Down
1 change: 0 additions & 1 deletion packages/ui/src/components/tool-error-card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ export function ToolErrorCard(props: ToolErrorCardProps) {
agent: "ui.tool.agent.default",
webfetch: "ui.tool.webfetch",
websearch: "ui.tool.websearch",
codesearch: "ui.tool.codesearch",
"enter-worktree": "ui.tool.worktree.enter",
"exit-worktree": "ui.tool.worktree.exit",
bash: "ui.tool.shell",
Expand Down
2 changes: 0 additions & 2 deletions packages/ui/src/components/tool-info.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,6 @@ export function buildToolInfo(part: ToolPart, i18n: UiI18n): ToolInfo {
return { icon: "window-cursor", title: i18n.t("ui.tool.webfetch"), subtitle: input.url }
case "websearch":
return { icon: "window-cursor", title: i18n.t("ui.tool.websearch"), subtitle: input.query }
case "codesearch":
return { icon: "code", title: i18n.t("ui.tool.codesearch"), subtitle: input.query }
case "enter-worktree": {
return {
icon: "worktree",
Expand Down
1 change: 0 additions & 1 deletion packages/ui/src/i18n/ar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ export const dict = {
"ui.tool.grep": "Grep",
"ui.tool.webfetch": "جلب الويب",
"ui.tool.websearch": "بحث الويب",
"ui.tool.codesearch": "بحث الكود",
"ui.tool.shell": "Shell",
"ui.tool.patch": "تصحيح",
"ui.tool.todos": "المهام",
Expand Down
1 change: 0 additions & 1 deletion packages/ui/src/i18n/br.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ export const dict = {
"ui.tool.grep": "Grep",
"ui.tool.webfetch": "Buscar Web",
"ui.tool.websearch": "Pesquisa na Web",
"ui.tool.codesearch": "Pesquisa de Código",
"ui.tool.shell": "Shell",
"ui.tool.patch": "Patch",
"ui.tool.todos": "Tarefas",
Expand Down
1 change: 0 additions & 1 deletion packages/ui/src/i18n/bs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ export const dict = {
"ui.tool.grep": "Grep",
"ui.tool.webfetch": "Web preuzimanje",
"ui.tool.websearch": "Pretraga weba",
"ui.tool.codesearch": "Pretraga koda",
"ui.tool.shell": "Shell",
"ui.tool.patch": "Patch",
"ui.tool.todos": "Lista zadataka",
Expand Down
Loading
Loading