Skip to content

Commit 98aeb60

Browse files
authored
fix: ensure @-ing a dir uses the read tool instead of dead list tool (anomalyco#13428)
1 parent 1608565 commit 98aeb60

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

packages/opencode/src/session/prompt.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ import { ToolRegistry } from "../tool/registry"
2626
import { MCP } from "../mcp"
2727
import { LSP } from "../lsp"
2828
import { ReadTool } from "../tool/read"
29-
import { ListTool } from "../tool/ls"
3029
import { FileTime } from "../file/time"
3130
import { Flag } from "../flag/flag"
3231
import { ulid } from "ulid"
@@ -1198,7 +1197,7 @@ export namespace SessionPrompt {
11981197
}
11991198

12001199
if (part.mime === "application/x-directory") {
1201-
const args = { path: filepath }
1200+
const args = { filePath: filepath }
12021201
const listCtx: Tool.Context = {
12031202
sessionID: input.sessionID,
12041203
abort: new AbortController().signal,
@@ -1209,15 +1208,15 @@ export namespace SessionPrompt {
12091208
metadata: async () => {},
12101209
ask: async () => {},
12111210
}
1212-
const result = await ListTool.init().then((t) => t.execute(args, listCtx))
1211+
const result = await ReadTool.init().then((t) => t.execute(args, listCtx))
12131212
return [
12141213
{
12151214
id: Identifier.ascending("part"),
12161215
messageID: info.id,
12171216
sessionID: input.sessionID,
12181217
type: "text",
12191218
synthetic: true,
1220-
text: `Called the list tool with the following input: ${JSON.stringify(args)}`,
1219+
text: `Called the Read tool with the following input: ${JSON.stringify(args)}`,
12211220
},
12221221
{
12231222
id: Identifier.ascending("part"),

0 commit comments

Comments
 (0)