Skip to content

Commit 26bab00

Browse files
committed
remove opencode_ prefixes from tool names. unfortunately this will break
all old sessions and share links. we'll be more backwards compatible in the future once we're more stable.
1 parent 568c047 commit 26bab00

File tree

18 files changed

+59
-59
lines changed

18 files changed

+59
-59
lines changed

packages/opencode/src/cli/cmd/run.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@ import { Flag } from "../../flag/flag"
1111
import { Config } from "../../config/config"
1212

1313
const TOOL: Record<string, [string, string]> = {
14-
opencode_todowrite: ["Todo", UI.Style.TEXT_WARNING_BOLD],
15-
opencode_todoread: ["Todo", UI.Style.TEXT_WARNING_BOLD],
16-
opencode_bash: ["Bash", UI.Style.TEXT_DANGER_BOLD],
17-
opencode_edit: ["Edit", UI.Style.TEXT_SUCCESS_BOLD],
18-
opencode_glob: ["Glob", UI.Style.TEXT_INFO_BOLD],
19-
opencode_grep: ["Grep", UI.Style.TEXT_INFO_BOLD],
20-
opencode_list: ["List", UI.Style.TEXT_INFO_BOLD],
21-
opencode_read: ["Read", UI.Style.TEXT_HIGHLIGHT_BOLD],
22-
opencode_write: ["Write", UI.Style.TEXT_SUCCESS_BOLD],
14+
todowrite: ["Todo", UI.Style.TEXT_WARNING_BOLD],
15+
todoread: ["Todo", UI.Style.TEXT_WARNING_BOLD],
16+
bash: ["Bash", UI.Style.TEXT_DANGER_BOLD],
17+
edit: ["Edit", UI.Style.TEXT_SUCCESS_BOLD],
18+
glob: ["Glob", UI.Style.TEXT_INFO_BOLD],
19+
grep: ["Grep", UI.Style.TEXT_INFO_BOLD],
20+
list: ["List", UI.Style.TEXT_INFO_BOLD],
21+
read: ["Read", UI.Style.TEXT_HIGHLIGHT_BOLD],
22+
write: ["Write", UI.Style.TEXT_SUCCESS_BOLD],
2323
}
2424

2525
export const RunCommand = cmd({

packages/opencode/src/provider/provider.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ export namespace Provider {
274274
const cfg = await Config.get()
275275
const provider = await list()
276276
.then((val) => Object.values(val))
277-
.then((x) => x.find((p) => !cfg.provider || cfg.provider === p.info.id))
277+
.then((x) => x.find((p) => !cfg.provider || Object.keys(cfg.provider).includes(p.info.id)))
278278
if (!provider) throw new Error("no providers found")
279279
const [model] = sort(Object.values(provider.info.models))
280280
if (!model) throw new Error("no models found")
@@ -304,7 +304,7 @@ export namespace Provider {
304304
]
305305

306306
const TOOL_MAPPING: Record<string, Tool.Info[]> = {
307-
anthropic: TOOLS.filter((t) => t.id !== "opencode.patch"),
307+
anthropic: TOOLS.filter((t) => t.id !== "patch"),
308308
openai: TOOLS.map((t) => ({
309309
...t,
310310
parameters: optionalToNullable(t.parameters),

packages/opencode/src/tool/bash.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ const DEFAULT_TIMEOUT = 1 * 60 * 1000
2626
const MAX_TIMEOUT = 10 * 60 * 1000
2727

2828
export const BashTool = Tool.define({
29-
id: "opencode.bash",
29+
id: "bash",
3030
description: DESCRIPTION,
3131
parameters: z.object({
3232
command: z.string().describe("The command to execute"),

packages/opencode/src/tool/edit.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import DESCRIPTION from "./edit.txt"
99
import { App } from "../app/app"
1010

1111
export const EditTool = Tool.define({
12-
id: "opencode.edit",
12+
id: "edit",
1313
description: DESCRIPTION,
1414
parameters: z.object({
1515
filePath: z.string().describe("The absolute path to the file to modify"),
@@ -35,7 +35,7 @@ export const EditTool = Tool.define({
3535
: path.join(app.path.cwd, params.filePath)
3636

3737
await Permission.ask({
38-
id: "opencode.edit",
38+
id: "edit",
3939
sessionID: ctx.sessionID,
4040
title: "Edit this file: " + filepath,
4141
metadata: {

packages/opencode/src/tool/glob.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { App } from "../app/app"
55
import DESCRIPTION from "./glob.txt"
66

77
export const GlobTool = Tool.define({
8-
id: "opencode.glob",
8+
id: "glob",
99
description: DESCRIPTION,
1010
parameters: z.object({
1111
pattern: z.string().describe("The glob pattern to match files against"),

packages/opencode/src/tool/grep.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { Ripgrep } from "../external/ripgrep"
66
import DESCRIPTION from "./grep.txt"
77

88
export const GrepTool = Tool.define({
9-
id: "opencode.grep",
9+
id: "grep",
1010
description: DESCRIPTION,
1111
parameters: z.object({
1212
pattern: z

packages/opencode/src/tool/ls.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export const IGNORE_PATTERNS = [
2121
const LIMIT = 100
2222

2323
export const ListTool = Tool.define({
24-
id: "opencode.list",
24+
id: "list",
2525
description: DESCRIPTION,
2626
parameters: z.object({
2727
path: z

packages/opencode/src/tool/lsp-diagnostics.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { App } from "../app/app"
66
import DESCRIPTION from "./lsp-diagnostics.txt"
77

88
export const LspDiagnosticTool = Tool.define({
9-
id: "opencode.lsp_diagnostics",
9+
id: "lsp_diagnostics",
1010
description: DESCRIPTION,
1111
parameters: z.object({
1212
path: z.string().describe("The path to the file to get diagnostics."),

packages/opencode/src/tool/lsp-hover.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { App } from "../app/app"
66
import DESCRIPTION from "./lsp-hover.txt"
77

88
export const LspHoverTool = Tool.define({
9-
id: "opencode.lsp_hover",
9+
id: "lsp_hover",
1010
description: DESCRIPTION,
1111
parameters: z.object({
1212
file: z.string().describe("The path to the file to get diagnostics."),

packages/opencode/src/tool/multiedit.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import path from "path"
66
import { App } from "../app/app"
77

88
export const MultiEditTool = Tool.define({
9-
id: "opencode.multiedit",
9+
id: "multiedit",
1010
description: DESCRIPTION,
1111
parameters: z.object({
1212
filePath: z.string().describe("The absolute path to the file to modify"),

0 commit comments

Comments
 (0)