Skip to content

Commit 2486621

Browse files
authored
chore: kill unused tool (#23701)
1 parent b5acc22 commit 2486621

47 files changed

Lines changed: 60 additions & 196 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

packages/opencode/specs/effect/instance-context.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,6 @@ These tools mostly use direct getters for path resolution and repo-relative disp
224224
- `src/tool/bash.ts`
225225
- `src/tool/edit.ts`
226226
- `src/tool/lsp.ts`
227-
- `src/tool/multiedit.ts`
228227
- `src/tool/plan.ts`
229228
- `src/tool/read.ts`
230229
- `src/tool/write.ts`

packages/opencode/specs/effect/schema.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,6 @@ emitted JSON Schema must stay byte-identical.
216216
- [ ] `src/tool/grep.ts`
217217
- [ ] `src/tool/invalid.ts`
218218
- [ ] `src/tool/lsp.ts`
219-
- [ ] `src/tool/multiedit.ts`
220219
- [ ] `src/tool/plan.ts`
221220
- [ ] `src/tool/question.ts`
222221
- [ ] `src/tool/read.ts`

packages/opencode/specs/effect/tools.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ These exported tool definitions currently use `Tool.define(...)` in `src/tool`:
4646
- [x] `grep.ts`
4747
- [x] `invalid.ts`
4848
- [x] `lsp.ts`
49-
- [x] `multiedit.ts`
5049
- [x] `plan.ts`
5150
- [x] `question.ts`
5251
- [x] `read.ts`
@@ -82,7 +81,6 @@ Notable items that are already effectively on the target path and do not need se
8281
- `write.ts`
8382
- `codesearch.ts`
8483
- `websearch.ts`
85-
- `multiedit.ts`
8684
- `edit.ts`
8785

8886
## Filesystem notes

packages/opencode/src/config/agent.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ const normalize = (agent: z.infer<typeof Info>) => {
9393
const permission: ConfigPermission.Info = {}
9494
for (const [tool, enabled] of Object.entries(agent.tools ?? {})) {
9595
const action = enabled ? "allow" : "deny"
96-
if (tool === "write" || tool === "edit" || tool === "patch" || tool === "multiedit") {
96+
if (tool === "write" || tool === "edit" || tool === "patch") {
9797
permission.edit = action
9898
continue
9999
}

packages/opencode/src/config/config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -660,7 +660,7 @@ export const layer = Layer.effect(
660660
const perms: Record<string, ConfigPermission.Action> = {}
661661
for (const [tool, enabled] of Object.entries(result.tools)) {
662662
const action: ConfigPermission.Action = enabled ? "allow" : "deny"
663-
if (tool === "write" || tool === "edit" || tool === "patch" || tool === "multiedit") {
663+
if (tool === "write" || tool === "edit" || tool === "patch") {
664664
perms.edit = action
665665
continue
666666
}

packages/opencode/src/permission/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ export function merge(...rulesets: Ruleset[]): Ruleset {
307307
return rulesets.flat()
308308
}
309309

310-
const EDIT_TOOLS = ["edit", "write", "apply_patch", "multiedit"]
310+
const EDIT_TOOLS = ["edit", "write", "apply_patch"]
311311

312312
export function disabled(tools: string[], ruleset: Ruleset): Set<string> {
313313
const result = new Set<string>()

packages/opencode/src/tool/multiedit.ts

Lines changed: 0 additions & 61 deletions
This file was deleted.

packages/opencode/src/tool/multiedit.txt

Lines changed: 0 additions & 41 deletions
This file was deleted.

packages/opencode/test/agent/agent.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -474,7 +474,7 @@ test("legacy tools config converts to permissions", async () => {
474474
})
475475
})
476476

477-
test("legacy tools config maps write/edit/patch/multiedit to edit permission", async () => {
477+
test("legacy tools config maps write/edit/patch to edit permission", async () => {
478478
await using tmp = await tmpdir({
479479
config: {
480480
agent: {

packages/opencode/test/config/config.test.ts

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1427,35 +1427,6 @@ test("migrates legacy patch tool to edit permission", async () => {
14271427
})
14281428
})
14291429

1430-
test("migrates legacy multiedit tool to edit permission", async () => {
1431-
await using tmp = await tmpdir({
1432-
init: async (dir) => {
1433-
await Filesystem.write(
1434-
path.join(dir, "opencode.json"),
1435-
JSON.stringify({
1436-
$schema: "https://opencode.ai/config.json",
1437-
agent: {
1438-
test: {
1439-
tools: {
1440-
multiedit: false,
1441-
},
1442-
},
1443-
},
1444-
}),
1445-
)
1446-
},
1447-
})
1448-
await Instance.provide({
1449-
directory: tmp.path,
1450-
fn: async () => {
1451-
const config = await load()
1452-
expect(config.agent?.["test"]?.permission).toEqual({
1453-
edit: "deny",
1454-
})
1455-
},
1456-
})
1457-
})
1458-
14591430
test("migrates mixed legacy tools config", async () => {
14601431
await using tmp = await tmpdir({
14611432
init: async (dir) => {

0 commit comments

Comments
 (0)