mirror of
https://github.com/anomalyco/opencode.git
synced 2026-05-18 02:22:32 +00:00
chore: kill unused tool (#23701)
This commit is contained in:
@@ -474,7 +474,7 @@ test("legacy tools config converts to permissions", async () => {
|
||||
})
|
||||
})
|
||||
|
||||
test("legacy tools config maps write/edit/patch/multiedit to edit permission", async () => {
|
||||
test("legacy tools config maps write/edit/patch to edit permission", async () => {
|
||||
await using tmp = await tmpdir({
|
||||
config: {
|
||||
agent: {
|
||||
|
||||
@@ -1427,35 +1427,6 @@ test("migrates legacy patch tool to edit permission", async () => {
|
||||
})
|
||||
})
|
||||
|
||||
test("migrates legacy multiedit tool to edit permission", async () => {
|
||||
await using tmp = await tmpdir({
|
||||
init: async (dir) => {
|
||||
await Filesystem.write(
|
||||
path.join(dir, "opencode.json"),
|
||||
JSON.stringify({
|
||||
$schema: "https://opencode.ai/config.json",
|
||||
agent: {
|
||||
test: {
|
||||
tools: {
|
||||
multiedit: false,
|
||||
},
|
||||
},
|
||||
},
|
||||
}),
|
||||
)
|
||||
},
|
||||
})
|
||||
await Instance.provide({
|
||||
directory: tmp.path,
|
||||
fn: async () => {
|
||||
const config = await load()
|
||||
expect(config.agent?.["test"]?.permission).toEqual({
|
||||
edit: "deny",
|
||||
})
|
||||
},
|
||||
})
|
||||
})
|
||||
|
||||
test("migrates mixed legacy tools config", async () => {
|
||||
await using tmp = await tmpdir({
|
||||
init: async (dir) => {
|
||||
|
||||
@@ -422,9 +422,9 @@ test("disabled - disables tool when denied", () => {
|
||||
expect(result.has("read")).toBe(false)
|
||||
})
|
||||
|
||||
test("disabled - disables edit/write/apply_patch/multiedit when edit denied", () => {
|
||||
test("disabled - disables edit/write/apply_patch when edit denied", () => {
|
||||
const result = Permission.disabled(
|
||||
["edit", "write", "apply_patch", "multiedit", "bash"],
|
||||
["edit", "write", "apply_patch", "bash"],
|
||||
[
|
||||
{ permission: "*", pattern: "*", action: "allow" },
|
||||
{ permission: "edit", pattern: "*", action: "deny" },
|
||||
@@ -433,7 +433,6 @@ test("disabled - disables edit/write/apply_patch/multiedit when edit denied", ()
|
||||
expect(result.has("edit")).toBe(true)
|
||||
expect(result.has("write")).toBe(true)
|
||||
expect(result.has("apply_patch")).toBe(true)
|
||||
expect(result.has("multiedit")).toBe(true)
|
||||
expect(result.has("bash")).toBe(false)
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user